diff options
author | Minseo Lee <itoupluk427@gmail.com> | 2024-02-29 09:51:56 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-29 09:51:56 +0900 |
commit | a1127bfcfc7ad080a5bd6210c6561788f1643db8 (patch) | |
tree | f2280d0308e4fc979f59f4f7abe3ef31a86390a2 /src/view/com/home/HomeHeader.tsx | |
parent | b723c4ca7ce22f673ea60e119da8552c452741da (diff) | |
parent | 7fd13cacfea4e9e4609ac2cfa11749544fc2f8f8 (diff) | |
download | voidsky-a1127bfcfc7ad080a5bd6210c6561788f1643db8.tar.zst |
Merge branch 'main' into patch-3
Diffstat (limited to 'src/view/com/home/HomeHeader.tsx')
-rw-r--r-- | src/view/com/home/HomeHeader.tsx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/view/com/home/HomeHeader.tsx b/src/view/com/home/HomeHeader.tsx index 3df3858ba..bbd16465a 100644 --- a/src/view/com/home/HomeHeader.tsx +++ b/src/view/com/home/HomeHeader.tsx @@ -1,7 +1,7 @@ import React from 'react' import {RenderTabBarFnProps} from 'view/com/pager/Pager' import {HomeHeaderLayout} from './HomeHeaderLayout' -import {usePinnedFeedsInfos} from '#/state/queries/feed' +import {FeedSourceInfo} from '#/state/queries/feed' import {useNavigation} from '@react-navigation/native' import {NavigationProp} from 'lib/routes/types' import {isWeb} from 'platform/detection' @@ -9,15 +9,22 @@ import {TabBar} from '../pager/TabBar' import {usePalette} from '#/lib/hooks/usePalette' export function HomeHeader( - props: RenderTabBarFnProps & {testID?: string; onPressSelected: () => void}, + props: RenderTabBarFnProps & { + testID?: string + onPressSelected: () => void + feeds: FeedSourceInfo[] + }, ) { + const {feeds} = props const navigation = useNavigation<NavigationProp>() - const {feeds, hasPinnedCustom} = usePinnedFeedsInfos() const pal = usePalette('default') + const hasPinnedCustom = React.useMemo<boolean>(() => { + return feeds.some(tab => tab.uri !== '') + }, [feeds]) + const items = React.useMemo(() => { const pinnedNames = feeds.map(f => f.displayName) - if (!hasPinnedCustom) { return pinnedNames.concat('Feeds ✨') } |