diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-09-09 22:40:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-09 22:40:25 +0300 |
commit | 372e20efa36c52a04cf2aa48816b82a1d96e0711 (patch) | |
tree | f662c38d29cb12c1a3c3860b58d7824690360548 /src/screens/Feeds/NoSavedFeedsOfAnyType.tsx | |
parent | 9e8bceec60f065bd52ea2e6c24b22ab42553d04d (diff) | |
download | voidsky-372e20efa36c52a04cf2aa48816b82a1d96e0711.tar.zst |
ALF saved feeds screen (#8844)
Diffstat (limited to 'src/screens/Feeds/NoSavedFeedsOfAnyType.tsx')
-rw-r--r-- | src/screens/Feeds/NoSavedFeedsOfAnyType.tsx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/screens/Feeds/NoSavedFeedsOfAnyType.tsx b/src/screens/Feeds/NoSavedFeedsOfAnyType.tsx index 8f6bd9d2e..db0ed1a7d 100644 --- a/src/screens/Feeds/NoSavedFeedsOfAnyType.tsx +++ b/src/screens/Feeds/NoSavedFeedsOfAnyType.tsx @@ -1,4 +1,3 @@ -import React from 'react' import {View} from 'react-native' import {TID} from '@atproto/common-web' import {msg, Trans} from '@lingui/macro' @@ -16,20 +15,25 @@ import {Text} from '#/components/Typography' * feeds if pressed. It should only be presented to the user if they actually * have no other feeds saved. */ -export function NoSavedFeedsOfAnyType() { +export function NoSavedFeedsOfAnyType({ + onAddRecommendedFeeds, +}: { + onAddRecommendedFeeds?: () => void +}) { const t = useTheme() const {_} = useLingui() const {isPending, mutateAsync: overwriteSavedFeeds} = useOverwriteSavedFeedsMutation() - const addRecommendedFeeds = React.useCallback(async () => { + const addRecommendedFeeds = async () => { + onAddRecommendedFeeds?.() await overwriteSavedFeeds( RECOMMENDED_SAVED_FEEDS.map(f => ({ ...f, id: TID.nextStr(), })), ) - }, [overwriteSavedFeeds]) + } return ( <View @@ -46,10 +50,9 @@ export function NoSavedFeedsOfAnyType() { disabled={isPending} label={_(msg`Apply default recommended feeds`)} size="small" - variant="solid" - color="primary" + color="primary_subtle" onPress={addRecommendedFeeds}> - <ButtonIcon icon={Plus} position="left" /> + <ButtonIcon icon={Plus} /> <ButtonText>{_(msg`Use recommended`)}</ButtonText> </Button> </View> |