From 40b0976c35f7d0fef2e78c0dbc2f486da7e45f19 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 14 Dec 2025 14:58:35 +0100 Subject: [PATCH] FriendsSince: fix in dms profile sidebar --- src/plugins/friendsSince/index.tsx | 65 +++++++++++++++++------------ src/plugins/friendsSince/styles.css | 3 ++ 2 files changed, 42 insertions(+), 26 deletions(-) create mode 100644 src/plugins/friendsSince/styles.css diff --git a/src/plugins/friendsSince/index.tsx b/src/plugins/friendsSince/index.tsx index 8c0c11c7e..c39b2600e 100644 --- a/src/plugins/friendsSince/index.tsx +++ b/src/plugins/friendsSince/index.tsx @@ -4,6 +4,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import "./styles.css"; + import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import { getCurrentChannel } from "@utils/discord"; @@ -15,7 +17,7 @@ const containerWrapper = findByPropsLazy("memberSinceWrapper"); const container = findByPropsLazy("memberSince"); const getCreatedAtDate = findByCodeLazy('month:"short",day:"numeric"'); const locale = findByPropsLazy("getLocale"); -const Section = findComponentByCodeLazy('headingVariant:"text-xs/medium"', ".section"); +const Section = findComponentByCodeLazy("headingVariant:", ".section", ".header"); export default definePlugin({ name: "FriendsSince", @@ -54,35 +56,46 @@ export default definePlugin({ const friendsSince = RelationshipStore.getSince(userId); if (!friendsSince) return null; + if (isSidebar) { + return ( +
+ + {getCreatedAtDate(friendsSince, locale.getLocale())} + +
+ ); + } + return ( -
- { - isSidebar ? ( +
+
+
+ {!!getCurrentChannel()?.guild_id && ( + + )} {getCreatedAtDate(friendsSince, locale.getLocale())} - ) : ( -
-
- {!!getCurrentChannel()?.guild_id && ( - - )} - - {getCreatedAtDate(friendsSince, locale.getLocale())} - -
-
- ) - } +
+
); }, { noop: true }), diff --git a/src/plugins/friendsSince/styles.css b/src/plugins/friendsSince/styles.css new file mode 100644 index 000000000..0e404c1b6 --- /dev/null +++ b/src/plugins/friendsSince/styles.css @@ -0,0 +1,3 @@ +.vc-friendsSince-profile-section { + gap: 4px; +} \ No newline at end of file