refactor(mobile): Update TimelineViewSelector context menu handling
- Modify TimelineViewSelector to pass view-specific context menu props - Adjust TimelineViewSelectorContextMenu to handle undefined viewId more precisely - Simplify context menu rendering logic for view-based timelines Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
parent
0d219a5a28
commit
63e6a30d83
|
|
@ -108,10 +108,7 @@ function ViewItem({ view }: { view: ViewDefinition }) {
|
|||
}, [isActive, unreadCount])
|
||||
|
||||
return (
|
||||
<TimelineViewSelectorContextMenu
|
||||
viewId={selectedFeed && "viewId" in selectedFeed ? selectedFeed.viewId : undefined}
|
||||
type={selectedFeed?.type}
|
||||
>
|
||||
<TimelineViewSelectorContextMenu type="view" viewId={view.view}>
|
||||
<ItemWrapper
|
||||
isActive={isActive}
|
||||
onPress={() => selectTimeline({ type: "view", viewId: view.view })}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { unreadSyncService } from "@/src/store/unread/store"
|
|||
export const TimelineViewSelectorContextMenu: FC<
|
||||
PropsWithChildren<{ type: string | undefined; viewId: FeedViewType | undefined }>
|
||||
> = ({ children, type, viewId }) => {
|
||||
if (type !== "view" || !viewId) return children
|
||||
if (type !== "view" || viewId === undefined) return children
|
||||
|
||||
return (
|
||||
<ContextMenu.Root>
|
||||
|
|
|
|||
Loading…
Reference in New Issue