From 629ca24e905bb7653546ce8741ec6c472efea1f8 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Wed, 24 May 2023 19:03:59 -0500 Subject: [PATCH] Tune the custom feed header --- src/view/com/util/forms/DropdownButton.tsx | 7 +- src/view/screens/CustomFeed.tsx | 95 ++++++++++++++++------ 2 files changed, 77 insertions(+), 25 deletions(-) diff --git a/src/view/com/util/forms/DropdownButton.tsx b/src/view/com/util/forms/DropdownButton.tsx index 36ef1f40..064b8211 100644 --- a/src/view/com/util/forms/DropdownButton.tsx +++ b/src/view/com/util/forms/DropdownButton.tsx @@ -136,7 +136,12 @@ export function DropdownButton({ } return ( - diff --git a/src/view/screens/CustomFeed.tsx b/src/view/screens/CustomFeed.tsx index f406c43d..0ade47c5 100644 --- a/src/view/screens/CustomFeed.tsx +++ b/src/view/screens/CustomFeed.tsx @@ -28,6 +28,7 @@ import {Haptics} from 'lib/haptics' import {ComposeIcon2} from 'lib/icons' import {FAB} from '../com/util/fab/FAB' import {LoadLatestBtn} from 'view/com/util/load-latest/LoadLatestBtn' +import {DropdownButton, DropdownItem} from 'view/com/util/forms/DropdownButton' import {useOnMainScroll} from 'lib/hooks/useOnMainScroll' type Props = NativeStackScreenProps @@ -108,6 +109,22 @@ export const CustomFeedScreen = withAuthRequired( store.shell.openComposer({}) }, [store]) + const dropdownItems: DropdownItem[] = React.useMemo(() => { + let items: DropdownItem[] = [ + { + testID: 'feedHeaderDropdownRemoveBtn', + label: 'Remove from my feeds', + onPress: onToggleSaved, + }, + { + testID: 'feedHeaderDropdownShareBtn', + label: 'Share link', + onPress: onPressShare, + }, + ] + return items + }, [onToggleSaved, onPressShare]) + const renderHeaderBtns = React.useCallback(() => { return ( @@ -132,25 +149,46 @@ export const CustomFeedScreen = withAuthRequired( )} + {currentFeed?.isSaved ? ( + + + + ) : ( + @@ -286,7 +325,7 @@ export const CustomFeedScreen = withAuthRequired( return ( - +