From fada76ec81d8d18bc4d1a92c09078bee42305cb8 Mon Sep 17 00:00:00 2001 From: Macintosh II <95250141+mctaylors@users.noreply.github.com> Date: Sat, 21 Oct 2023 19:41:56 +0300 Subject: [PATCH] PlatformIndicators: make size same as other memberlist icons (#1789) Co-authored-by: V --- src/plugins/platformIndicators/index.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/platformIndicators/index.tsx b/src/plugins/platformIndicators/index.tsx index 6a7a8be74..7233cd13d 100644 --- a/src/plugins/platformIndicators/index.tsx +++ b/src/plugins/platformIndicators/index.tsx @@ -30,13 +30,13 @@ import { User } from "discord-types/general"; const SessionsStore = findStoreLazy("SessionsStore"); function Icon(path: string, opts?: { viewBox?: string; width?: number; height?: number; }) { - return ({ color, tooltip }: { color: string; tooltip: string; }) => ( + return ({ color, tooltip, small }: { color: string; tooltip: string; small: boolean; }) => ( {(tooltipProps: any) => ( @@ -57,16 +57,16 @@ type Platform = keyof typeof Icons; const getStatusColor = findByCodeLazy(".TWITCH", ".STREAMING", ".INVISIBLE"); -const PlatformIcon = ({ platform, status }: { platform: Platform, status: string; }) => { +const PlatformIcon = ({ platform, status, small }: { platform: Platform, status: string; small: boolean; }) => { const tooltip = platform[0].toUpperCase() + platform.slice(1); const Icon = Icons[platform] ?? Icons.desktop; - return ; + return ; }; const getStatus = (id: string): Record => PresenceStore.getState()?.clientStatuses?.[id]; -const PlatformIndicator = ({ user, wantMargin = true, wantTopMargin = false }: { user: User; wantMargin?: boolean; wantTopMargin?: boolean; }) => { +const PlatformIndicator = ({ user, wantMargin = true, wantTopMargin = false, small = false }: { user: User; wantMargin?: boolean; wantTopMargin?: boolean; small?: boolean; }) => { if (!user || user.bot) return null; if (user.id === UserStore.getCurrentUser().id) { @@ -99,6 +99,7 @@ const PlatformIndicator = ({ user, wantMargin = true, wantTopMargin = false }: { key={platform} platform={platform as Platform} status={status} + small={small} /> )); @@ -137,7 +138,7 @@ const indicatorLocations = { description: "In the member list", onEnable: () => addDecorator("platform-indicator", props => - + ), onDisable: () => removeDecorator("platform-indicator")