diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-09-05 18:39:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-05 08:39:28 -0700 |
commit | daed047bb41bcdac374398b06f87895511ea34a8 (patch) | |
tree | 559fa4d9c0d65eb4fd0c8269ee53a73e5a0d7934 /src/view/com/home/HomeHeader.tsx | |
parent | ee3e08393882a9d72ae9cab5f765ed2885c5a98d (diff) | |
download | voidsky-daed047bb41bcdac374398b06f87895511ea34a8.tar.zst |
[Perf] Drawer gesture perf fix + related cleanup (#8953)
* split drawer layout into own component * don't put props in dep array * memoize pager view
Diffstat (limited to 'src/view/com/home/HomeHeader.tsx')
-rw-r--r-- | src/view/com/home/HomeHeader.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/view/com/home/HomeHeader.tsx b/src/view/com/home/HomeHeader.tsx index 0ec9ac753..4ae344549 100644 --- a/src/view/com/home/HomeHeader.tsx +++ b/src/view/com/home/HomeHeader.tsx @@ -1,10 +1,10 @@ import React from 'react' import {useNavigation} from '@react-navigation/native' -import {NavigationProp} from '#/lib/routes/types' -import {FeedSourceInfo} from '#/state/queries/feed' +import {type NavigationProp} from '#/lib/routes/types' +import {type FeedSourceInfo} from '#/state/queries/feed' import {useSession} from '#/state/session' -import {RenderTabBarFnProps} from '#/view/com/pager/Pager' +import {type RenderTabBarFnProps} from '#/view/com/pager/Pager' import {TabBar} from '../pager/TabBar' import {HomeHeaderLayout} from './HomeHeaderLayout' @@ -15,7 +15,7 @@ export function HomeHeader( feeds: FeedSourceInfo[] }, ) { - const {feeds} = props + const {feeds, onSelect: onSelectProp} = props const {hasSession} = useSession() const navigation = useNavigation<NavigationProp>() @@ -43,11 +43,11 @@ export function HomeHeader( (index: number) => { if (!hasPinnedCustom && index === items.length - 1) { onPressFeedsLink() - } else if (props.onSelect) { - props.onSelect(index) + } else if (onSelectProp) { + onSelectProp(index) } }, - [items.length, onPressFeedsLink, props, hasPinnedCustom], + [items.length, onPressFeedsLink, onSelectProp, hasPinnedCustom], ) return ( |