From b412798958ab4fc0c184b3a17efcc62820655250 Mon Sep 17 00:00:00 2001 From: Innei Date: Wed, 19 Feb 2025 18:48:44 +0800 Subject: [PATCH] refactor(mobile): Simplify EntryListSelector and ViewPagerList component structure Move TimelineSelectorHeader to wrap ViewPagerList and remove redundant wrapping in EntryListSelector Signed-off-by: Innei --- .../modules/entry-list/EntryListSelector.tsx | 7 +-- apps/mobile/src/modules/entry-list/index.tsx | 49 ++++++++++--------- 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/apps/mobile/src/modules/entry-list/EntryListSelector.tsx b/apps/mobile/src/modules/entry-list/EntryListSelector.tsx index d1e25e11e..b24b21fd0 100644 --- a/apps/mobile/src/modules/entry-list/EntryListSelector.tsx +++ b/apps/mobile/src/modules/entry-list/EntryListSelector.tsx @@ -2,7 +2,6 @@ import { FeedViewType } from "@follow/constants" import { EntryListContentGrid } from "@/src/modules/entry-list/EntryListContentGrid" -import { TimelineSelectorHeader } from "../screen/TimelineSelectorHeader" import { EntryListContentArticle } from "./EntryListContentArticle" import { EntryListContentSocial } from "./EntryListContentSocial" @@ -30,9 +29,5 @@ export function EntryListSelector({ } } - return ( - - - - ) + return } diff --git a/apps/mobile/src/modules/entry-list/index.tsx b/apps/mobile/src/modules/entry-list/index.tsx index 8a497a456..650284b82 100644 --- a/apps/mobile/src/modules/entry-list/index.tsx +++ b/apps/mobile/src/modules/entry-list/index.tsx @@ -19,6 +19,7 @@ import { } from "@/src/store/entry/hooks" import { useListEntryIds } from "@/src/store/list/hooks" +import { TimelineSelectorHeader } from "../screen/TimelineSelectorHeader" import { EntryListSelector } from "./EntryListSelector" import { usePagerView } from "./usePagerView" @@ -73,29 +74,31 @@ function ViewPagerList({ viewId }: { viewId: FeedViewType }) { return ( - - {useMemo( - () => - views.map((view) => ( - - - - )), - [], - )} - + + + {useMemo( + () => + views.map((view) => ( + + + + )), + [], + )} + + ) }