From aaba22f5773751ce0ed5f4ccba4795bc789dfa2d Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 9 Jun 2024 03:44:52 +0200 Subject: [PATCH] ShowConnections: improve look in simplified prof; fix tooltip overflow --- src/plugins/_core/settings.tsx | 1 + src/plugins/showConnections/index.tsx | 54 +++++++++++++++++--------- src/plugins/showConnections/styles.css | 8 ++++ src/plugins/usrbg/index.tsx | 7 ---- 4 files changed, 45 insertions(+), 25 deletions(-) diff --git a/src/plugins/_core/settings.tsx b/src/plugins/_core/settings.tsx index fd221d27..88ee05ff 100644 --- a/src/plugins/_core/settings.tsx +++ b/src/plugins/_core/settings.tsx @@ -60,6 +60,7 @@ export default definePlugin({ // FIXME: remove once change merged to stable { find: "Messages.ACTIVITY_SETTINGS", + noWarn: true, replacement: { get match() { switch (Settings.plugins.Settings.settingsLocation) { diff --git a/src/plugins/showConnections/index.tsx b/src/plugins/showConnections/index.tsx index 505f696d..733d069e 100644 --- a/src/plugins/showConnections/index.tsx +++ b/src/plugins/showConnections/index.tsx @@ -74,15 +74,28 @@ interface ConnectionPlatform { icon: { lightSVG: string, darkSVG: string; }; } -const profilePopoutComponent = ErrorBoundary.wrap((props: { user: User, displayProfile, compactSpacing; }) => - +const profilePopoutComponent = ErrorBoundary.wrap( + (props: { user: User; displayProfile?: any; simplified?: boolean; }) => ( + + ), + { noop: true } ); -const profilePanelComponent = ErrorBoundary.wrap(({ id }: { id: string; }) => - +const profilePanelComponent = ErrorBoundary.wrap( + (props: { id: string; simplified?: boolean; }) => ( + + ), + { noop: true } ); -function ConnectionsComponent({ id, theme, compactSpacing }: { id: string, theme: string, compactSpacing?: boolean; }) { +function ConnectionsComponent({ id, theme, simplified }: { id: string, theme: string, simplified?: boolean; }) { const profile = UserProfileStore.getUserProfile(id); if (!profile) return null; @@ -91,10 +104,21 @@ function ConnectionsComponent({ id, theme, compactSpacing }: { id: string, theme if (!connections?.length) return null; - const Container = compactSpacing ? "div" : Section; + const connectionsContainer = ( + + {connections.map(connection => )} + + ); + + if (simplified) + return connectionsContainer; return ( - +
Connections - - {connections.map(connection => )} - - + {connectionsContainer} +
); } @@ -134,7 +152,7 @@ function CompactConnectionComponent({ connection, theme }: { connection: Connect - {connection.name} + {connection.name} {connection.verified && } @@ -180,7 +198,7 @@ export default definePlugin({ find: "{isUsingGuildBio:null!==(", replacement: { match: /,theme:\i\}\)(?=,.{0,150}setNote:)/, - replace: "$&,$self.profilePopoutComponent({ user: arguments[0].user, displayProfile: arguments[0].displayProfile, compactSpacing: false })" + replace: "$&,$self.profilePopoutComponent({ user: arguments[0].user, displayProfile: arguments[0].displayProfile })" } }, { @@ -195,7 +213,7 @@ export default definePlugin({ find: "autoFocusNote:!0})", replacement: { match: /{autoFocusNote:!1}\)}\)(?<=user:(\i),bio:null==(\i)\?.+?)/, - replace: "$&,$self.profilePopoutComponent({ user: $1, displayProfile: $2, compactSpacing: true })" + replace: "$&,$self.profilePopoutComponent({ user: $1, displayProfile: $2, simplified: true })" } } ], diff --git a/src/plugins/showConnections/styles.css b/src/plugins/showConnections/styles.css index 383593c1..cead5201 100644 --- a/src/plugins/showConnections/styles.css +++ b/src/plugins/showConnections/styles.css @@ -9,3 +9,11 @@ gap: 0.25em; align-items: center; } + +.vc-sc-connection-name { + word-break: break-all; +} + +.vc-sc-tooltip svg { + min-width: 16px; +} diff --git a/src/plugins/usrbg/index.tsx b/src/plugins/usrbg/index.tsx index 32da95af..d9af54c3 100644 --- a/src/plugins/usrbg/index.tsx +++ b/src/plugins/usrbg/index.tsx @@ -69,13 +69,6 @@ export default definePlugin({ } ] }, - { - find: "=!1,canUsePremiumCustomization:", - replacement: { - match: /(\i)\.premiumType/, - replace: "$self.patchPremiumType($1)||$&" - } - }, { find: "BannerLoadingStatus:function", replacement: {