From d2a0324647200ad6579df04916303432ee3892c0 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sun, 4 May 2025 00:21:12 -0400 Subject: [PATCH] Fix MoreUserTags Settings --- src/components/PluginSettings/PluginModal.tsx | 12 +-- src/equicordplugins/moreUserTags/settings.tsx | 98 ++++++++++++------- .../components/NotificationComponent.tsx | 6 +- 3 files changed, 67 insertions(+), 49 deletions(-) diff --git a/src/components/PluginSettings/PluginModal.tsx b/src/components/PluginSettings/PluginModal.tsx index fa11674b..69a2273f 100644 --- a/src/components/PluginSettings/PluginModal.tsx +++ b/src/components/PluginSettings/PluginModal.tsx @@ -179,20 +179,18 @@ export default function PluginModal({ plugin, onRestartNeeded, onClose, transiti } } - function renderMoreUsers(_label: string, count: number) { - const sliceCount = plugin.authors.length - count; - const sliceStart = plugin.authors.length - sliceCount; - const sliceEnd = sliceStart + plugin.authors.length - count; + function renderMoreUsers(_label: string) { + const remainingAuthors = plugin.authors.slice(6); return ( - u.name).join(", ")}> + u.name).join(", ")}> {({ onMouseEnter, onMouseLeave }) => (
- +{sliceCount} + +{remainingAuthors.length}
)}
@@ -252,7 +250,7 @@ export default function PluginModal({ plugin, onRestartNeeded, onClose, transiti renderIcon={false} showDefaultAvatarsForNullUsers showUserPopout - renderMoreUsers={plugin.authors.length > 6 ? renderMoreUsers : undefined} + renderMoreUsers={renderMoreUsers} renderUser={(user: User) => ( - {tags.map(t => ( - - - - {({ onMouseEnter, onMouseLeave }) => ( -
- {t.displayName} Tag -
- )} -
-
- - tagSettings[t.name].text = v} - className={Margins.bottom16} - /> - - tagSettings[t.name].showInChat = v} - hideBorder +
+ {tags.map(t => ( + - Show in messages - + + + {({ onMouseEnter, onMouseLeave }) => ( +
+ {t.displayName} Tag +
+ )} +
+
- tagSettings[t.name].showInNotChat = v} - hideBorder - > - Show in member list and profiles - -
- ))} +
+ + Example: + + +
+ + tagSettings[t.name].text = v} + className={Margins.bottom16} + /> + + tagSettings[t.name].showInChat = v} + hideBorder + > + Show in messages + + + tagSettings[t.name].showInNotChat = v} + hideBorder + > + Show in member list and profiles + + + ))} +
); } diff --git a/src/equicordplugins/toastNotifications/components/NotificationComponent.tsx b/src/equicordplugins/toastNotifications/components/NotificationComponent.tsx index 0f6adb75..207d99bb 100644 --- a/src/equicordplugins/toastNotifications/components/NotificationComponent.tsx +++ b/src/equicordplugins/toastNotifications/components/NotificationComponent.tsx @@ -44,11 +44,9 @@ export default ErrorBoundary.wrap(function NotificationComponent({ let renderBody: boolean = true; let footer: boolean = false; - if (attachments > 0) - footer = true; + if (attachments > 0) footer = true; - if (body === "") - renderBody = false; + if (body === "") renderBody = false; // Precompute appearance settings. const AppearanceSettings = {