From f2916ce528ed55136299e4fc39c37eb1565c3d08 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 12 Nov 2024 20:44:13 +0000 Subject: [PATCH] Slightly reduce rerenders in drawer (#6270) * slightly reduce renders in drawer * fix missing hook --- src/view/shell/Drawer.tsx | 69 +++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 257506dd0b..3dc2b076c4 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -122,9 +122,8 @@ let DrawerProfileCard = ({ DrawerProfileCard = React.memo(DrawerProfileCard) export {DrawerProfileCard} -let DrawerContent = ({}: {}): React.ReactNode => { +let DrawerContent = ({}: React.PropsWithoutRef<{}>): React.ReactNode => { const t = useTheme() - const {_} = useLingui() const insets = useSafeAreaInsets() const setDrawerOpen = useSetDrawerOpen() const navigation = useNavigation() @@ -137,7 +136,6 @@ let DrawerContent = ({}: {}): React.ReactNode => { isAtMessages, } = useNavigationTabState() const {hasSession, currentAccount} = useSession() - const kawaii = useKawaiiMode() // events // = @@ -277,34 +275,7 @@ let DrawerContent = ({}: {}): React.ReactNode => { - - - - Terms of Service - - - Privacy Policy - - {kawaii && ( - - - Logo by{' '} - - @sawaratsuki.bsky.social - - - - )} - + @@ -633,3 +604,39 @@ function MenuItem({icon, label, count, bold, onPress}: MenuItemProps) { ) } + +function ExtraLinks() { + const {_} = useLingui() + const t = useTheme() + const kawaii = useKawaiiMode() + + return ( + + + Terms of Service + + + Privacy Policy + + {kawaii && ( + + + Logo by{' '} + + @sawaratsuki.bsky.social + + + + )} + + ) +}