From 90a2c3c34d4c91949be5661a0dd57f24566d7b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Jaeger=20Foresti?= <60678893+juliajforesti@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:28:10 -0300 Subject: [PATCH] chore: remove sidepanel item warnings (#34084) --- apps/meteor/client/sidebarv2/Item/Condensed.tsx | 4 ++-- apps/meteor/client/sidebarv2/Item/Medium.tsx | 4 ++-- .../meteor/client/views/room/Sidepanel/hooks/useItemData.tsx | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/meteor/client/sidebarv2/Item/Condensed.tsx b/apps/meteor/client/sidebarv2/Item/Condensed.tsx index 385f5a57d9b8..d180fe8d27fc 100644 --- a/apps/meteor/client/sidebarv2/Item/Condensed.tsx +++ b/apps/meteor/client/sidebarv2/Item/Condensed.tsx @@ -19,7 +19,7 @@ type CondensedProps = { clickable?: boolean; } & Omit, 'is'>; -const Condensed = ({ icon, title, avatar, actions, href, unread, menu, badges, selected, ...props }: CondensedProps) => { +const Condensed = ({ icon, title, avatar, actions, unread, menu, badges, ...props }: CondensedProps) => { const [menuVisibility, setMenuVisibility] = useState(!!window.DISABLE_ANIMATION); const isReduceMotionEnabled = usePrefersReducedMotion(); @@ -32,7 +32,7 @@ const Condensed = ({ icon, title, avatar, actions, href, unread, menu, badges, s }; return ( - + {avatar && {avatar}} {icon && icon} {title} diff --git a/apps/meteor/client/sidebarv2/Item/Medium.tsx b/apps/meteor/client/sidebarv2/Item/Medium.tsx index fbdb9646447a..705ff53b169b 100644 --- a/apps/meteor/client/sidebarv2/Item/Medium.tsx +++ b/apps/meteor/client/sidebarv2/Item/Medium.tsx @@ -18,7 +18,7 @@ type MediumProps = { menuOptions?: any; } & Omit, 'is'>; -const Medium = ({ icon, title, avatar, actions, href, badges, unread, menu, selected, ...props }: MediumProps) => { +const Medium = ({ icon, title, avatar, actions, badges, unread, menu, ...props }: MediumProps) => { const [menuVisibility, setMenuVisibility] = useState(!!window.DISABLE_ANIMATION); const isReduceMotionEnabled = usePrefersReducedMotion(); @@ -31,7 +31,7 @@ const Medium = ({ icon, title, avatar, actions, href, badges, unread, menu, sele }; return ( - + {avatar} {icon && icon} {title} diff --git a/apps/meteor/client/views/room/Sidepanel/hooks/useItemData.tsx b/apps/meteor/client/views/room/Sidepanel/hooks/useItemData.tsx index 89aa1887c938..8e8cb798d2f7 100644 --- a/apps/meteor/client/views/room/Sidepanel/hooks/useItemData.tsx +++ b/apps/meteor/client/views/room/Sidepanel/hooks/useItemData.tsx @@ -23,7 +23,7 @@ export const useItemData = ( [highlighted, room], ); const time = 'lastMessage' in room ? room.lastMessage?.ts : undefined; - const message = viewMode === 'extended' && getMessage(room, room.lastMessage, t); + const message = viewMode === 'extended' ? getMessage(room, room.lastMessage, t) : undefined; const badges = useMemo( () => ( @@ -42,7 +42,6 @@ export const useItemData = ( () => ({ unread: highlighted, selected: room.rid === openedRoom, - t, href: roomCoordinator.getRouteLink(room.t, room) || '', title: roomCoordinator.getRoomName(room.t, room) || '', icon, @@ -51,7 +50,7 @@ export const useItemData = ( avatar: AvatarTemplate && , subtitle: message, }), - [AvatarTemplate, badges, highlighted, icon, message, openedRoom, room, t, time], + [AvatarTemplate, badges, highlighted, icon, message, openedRoom, room, time], ); return itemData;