ALF saved feeds screen (#8844)

This commit is contained in:
Samuel Newman
2025-09-09 22:40:25 +03:00
committed by GitHub
parent 9e8bceec60
commit 372e20efa3
4 changed files with 173 additions and 207 deletions
+1 -1
View File
@@ -64,7 +64,6 @@ import {PostThreadScreen} from '#/view/screens/PostThread'
import {PrivacyPolicyScreen} from '#/view/screens/PrivacyPolicy' import {PrivacyPolicyScreen} from '#/view/screens/PrivacyPolicy'
import {ProfileScreen} from '#/view/screens/Profile' import {ProfileScreen} from '#/view/screens/Profile'
import {ProfileFeedLikedByScreen} from '#/view/screens/ProfileFeedLikedBy' import {ProfileFeedLikedByScreen} from '#/view/screens/ProfileFeedLikedBy'
import {SavedFeeds} from '#/view/screens/SavedFeeds'
import {Storybook} from '#/view/screens/Storybook' import {Storybook} from '#/view/screens/Storybook'
import {SupportScreen} from '#/view/screens/Support' import {SupportScreen} from '#/view/screens/Support'
import {TermsOfServiceScreen} from '#/view/screens/TermsOfService' import {TermsOfServiceScreen} from '#/view/screens/TermsOfService'
@@ -92,6 +91,7 @@ import {ProfileFollowsScreen} from '#/screens/Profile/ProfileFollows'
import {ProfileLabelerLikedByScreen} from '#/screens/Profile/ProfileLabelerLikedBy' import {ProfileLabelerLikedByScreen} from '#/screens/Profile/ProfileLabelerLikedBy'
import {ProfileSearchScreen} from '#/screens/Profile/ProfileSearch' import {ProfileSearchScreen} from '#/screens/Profile/ProfileSearch'
import {ProfileListScreen} from '#/screens/ProfileList' import {ProfileListScreen} from '#/screens/ProfileList'
import {SavedFeeds} from '#/screens/SavedFeeds'
import {SearchScreen} from '#/screens/Search' import {SearchScreen} from '#/screens/Search'
import {AboutSettingsScreen} from '#/screens/Settings/AboutSettings' import {AboutSettingsScreen} from '#/screens/Settings/AboutSettings'
import {AccessibilitySettingsScreen} from '#/screens/Settings/AccessibilitySettings' import {AccessibilitySettingsScreen} from '#/screens/Settings/AccessibilitySettings'
+8 -10
View File
@@ -1,5 +1,4 @@
import React from 'react' import {type GestureResponderEvent, View} from 'react-native'
import {View} from 'react-native'
import {msg, Trans} from '@lingui/macro' import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
@@ -9,13 +8,12 @@ import {atoms as a, useTheme} from '#/alf'
import {InlineLinkText} from '#/components/Link' import {InlineLinkText} from '#/components/Link'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
export function NoFollowingFeed() { export function NoFollowingFeed({onAddFeed}: {onAddFeed?: () => void}) {
const t = useTheme() const t = useTheme()
const {_} = useLingui() const {_} = useLingui()
const {mutateAsync: addSavedFeeds} = useAddSavedFeedsMutation() const {mutateAsync: addSavedFeeds} = useAddSavedFeedsMutation()
const addRecommendedFeeds = React.useCallback( const addRecommendedFeeds = (e: GestureResponderEvent) => {
(e: any) => {
e.preventDefault() e.preventDefault()
addSavedFeeds([ addSavedFeeds([
@@ -25,11 +23,11 @@ export function NoFollowingFeed() {
}, },
]) ])
onAddFeed?.()
// prevent navigation // prevent navigation
return false return false as const
}, }
[addSavedFeeds],
)
return ( return (
<View style={[a.flex_row, a.flex_wrap, a.align_center, a.py_md, a.px_lg]}> <View style={[a.flex_row, a.flex_wrap, a.align_center, a.py_md, a.px_lg]}>
@@ -37,7 +35,7 @@ export function NoFollowingFeed() {
<Trans> <Trans>
Looks like you're missing a following feed.{' '} Looks like you're missing a following feed.{' '}
<InlineLinkText <InlineLinkText
to="/" to="#"
label={_(msg`Add the default feed of only people you follow`)} label={_(msg`Add the default feed of only people you follow`)}
onPress={addRecommendedFeeds} onPress={addRecommendedFeeds}
style={[a.leading_snug]}> style={[a.leading_snug]}>
+10 -7
View File
@@ -1,4 +1,3 @@
import React from 'react'
import {View} from 'react-native' import {View} from 'react-native'
import {TID} from '@atproto/common-web' import {TID} from '@atproto/common-web'
import {msg, Trans} from '@lingui/macro' 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 * feeds if pressed. It should only be presented to the user if they actually
* have no other feeds saved. * have no other feeds saved.
*/ */
export function NoSavedFeedsOfAnyType() { export function NoSavedFeedsOfAnyType({
onAddRecommendedFeeds,
}: {
onAddRecommendedFeeds?: () => void
}) {
const t = useTheme() const t = useTheme()
const {_} = useLingui() const {_} = useLingui()
const {isPending, mutateAsync: overwriteSavedFeeds} = const {isPending, mutateAsync: overwriteSavedFeeds} =
useOverwriteSavedFeedsMutation() useOverwriteSavedFeedsMutation()
const addRecommendedFeeds = React.useCallback(async () => { const addRecommendedFeeds = async () => {
onAddRecommendedFeeds?.()
await overwriteSavedFeeds( await overwriteSavedFeeds(
RECOMMENDED_SAVED_FEEDS.map(f => ({ RECOMMENDED_SAVED_FEEDS.map(f => ({
...f, ...f,
id: TID.nextStr(), id: TID.nextStr(),
})), })),
) )
}, [overwriteSavedFeeds]) }
return ( return (
<View <View
@@ -46,10 +50,9 @@ export function NoSavedFeedsOfAnyType() {
disabled={isPending} disabled={isPending}
label={_(msg`Apply default recommended feeds`)} label={_(msg`Apply default recommended feeds`)}
size="small" size="small"
variant="solid" color="primary_subtle"
color="primary"
onPress={addRecommendedFeeds}> onPress={addRecommendedFeeds}>
<ButtonIcon icon={Plus} position="left" /> <ButtonIcon icon={Plus} />
<ButtonText>{_(msg`Use recommended`)}</ButtonText> <ButtonText>{_(msg`Use recommended`)}</ButtonText>
</Button> </Button>
</View> </View>
@@ -1,22 +1,20 @@
import React from 'react' import {useCallback, useState} from 'react'
import {ActivityIndicator, Pressable, StyleSheet, View} from 'react-native' import {View} from 'react-native'
import Animated, {LinearTransition} from 'react-native-reanimated' import Animated, {LinearTransition} from 'react-native-reanimated'
import {type AppBskyActorDefs} from '@atproto/api' import {type AppBskyActorDefs} from '@atproto/api'
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {TID} from '@atproto/common-web'
import {msg, Trans} from '@lingui/macro' import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
import {useFocusEffect} from '@react-navigation/native' import {useFocusEffect} from '@react-navigation/native'
import {useNavigation} from '@react-navigation/native' import {useNavigation} from '@react-navigation/native'
import {type NativeStackScreenProps} from '@react-navigation/native-stack' import {type NativeStackScreenProps} from '@react-navigation/native-stack'
import {RECOMMENDED_SAVED_FEEDS, TIMELINE_SAVED_FEED} from '#/lib/constants'
import {useHaptics} from '#/lib/haptics' import {useHaptics} from '#/lib/haptics'
import {usePalette} from '#/lib/hooks/usePalette'
import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
import { import {
type CommonNavigatorParams, type CommonNavigatorParams,
type NavigationProp, type NavigationProp,
} from '#/lib/routes/types' } from '#/lib/routes/types'
import {colors, s} from '#/lib/styles'
import {logger} from '#/logger' import {logger} from '#/logger'
import { import {
useOverwriteSavedFeedsMutation, useOverwriteSavedFeedsMutation,
@@ -25,18 +23,24 @@ import {
import {type UsePreferencesQueryResponse} from '#/state/queries/preferences/types' import {type UsePreferencesQueryResponse} from '#/state/queries/preferences/types'
import {useSetMinimalShellMode} from '#/state/shell' import {useSetMinimalShellMode} from '#/state/shell'
import {FeedSourceCard} from '#/view/com/feeds/FeedSourceCard' import {FeedSourceCard} from '#/view/com/feeds/FeedSourceCard'
import {TextLink} from '#/view/com/util/Link'
import {Text} from '#/view/com/util/text/Text'
import * as Toast from '#/view/com/util/Toast' import * as Toast from '#/view/com/util/Toast'
import {NoFollowingFeed} from '#/screens/Feeds/NoFollowingFeed' import {NoFollowingFeed} from '#/screens/Feeds/NoFollowingFeed'
import {NoSavedFeedsOfAnyType} from '#/screens/Feeds/NoSavedFeedsOfAnyType' import {NoSavedFeedsOfAnyType} from '#/screens/Feeds/NoSavedFeedsOfAnyType'
import {atoms as a, useTheme} from '#/alf' import {atoms as a, useBreakpoints, useTheme} from '#/alf'
import {Admonition} from '#/components/Admonition'
import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {Button, ButtonIcon, ButtonText} from '#/components/Button'
import {
ArrowBottom_Stroke2_Corner0_Rounded as ArrowDownIcon,
ArrowTop_Stroke2_Corner0_Rounded as ArrowUpIcon,
} from '#/components/icons/Arrow'
import {FilterTimeline_Stroke2_Corner0_Rounded as FilterTimeline} from '#/components/icons/FilterTimeline' import {FilterTimeline_Stroke2_Corner0_Rounded as FilterTimeline} from '#/components/icons/FilterTimeline'
import {FloppyDisk_Stroke2_Corner0_Rounded as SaveIcon} from '#/components/icons/FloppyDisk' import {FloppyDisk_Stroke2_Corner0_Rounded as SaveIcon} from '#/components/icons/FloppyDisk'
import {Pin_Filled_Corner0_Rounded as PinIcon} from '#/components/icons/Pin'
import {Trash_Stroke2_Corner0_Rounded as TrashIcon} from '#/components/icons/Trash'
import * as Layout from '#/components/Layout' import * as Layout from '#/components/Layout'
import {InlineLinkText} from '#/components/Link'
import {Loader} from '#/components/Loader' import {Loader} from '#/components/Loader'
import {Text as NewText} from '#/components/Typography' import {Text} from '#/components/Typography'
type Props = NativeStackScreenProps<CommonNavigatorParams, 'SavedFeeds'> type Props = NativeStackScreenProps<CommonNavigatorParams, 'SavedFeeds'>
export function SavedFeeds({}: Props) { export function SavedFeeds({}: Props) {
@@ -52,9 +56,9 @@ function SavedFeedsInner({
}: { }: {
preferences: UsePreferencesQueryResponse preferences: UsePreferencesQueryResponse
}) { }) {
const pal = usePalette('default') const t = useTheme()
const {_} = useLingui() const {_} = useLingui()
const {isMobile, isDesktop} = useWebMediaQueries() const {gtMobile} = useBreakpoints()
const setMinimalShellMode = useSetMinimalShellMode() const setMinimalShellMode = useSetMinimalShellMode()
const {mutateAsync: overwriteSavedFeeds, isPending: isOverwritePending} = const {mutateAsync: overwriteSavedFeeds, isPending: isOverwritePending} =
useOverwriteSavedFeedsMutation() useOverwriteSavedFeedsMutation()
@@ -64,7 +68,7 @@ function SavedFeedsInner({
* Use optimistic data if exists and no error, otherwise fallback to remote * Use optimistic data if exists and no error, otherwise fallback to remote
* data * data
*/ */
const [currentFeeds, setCurrentFeeds] = React.useState( const [currentFeeds, setCurrentFeeds] = useState(
() => preferences.savedFeeds || [], () => preferences.savedFeeds || [],
) )
const hasUnsavedChanges = currentFeeds !== preferences.savedFeeds const hasUnsavedChanges = currentFeeds !== preferences.savedFeeds
@@ -75,12 +79,12 @@ function SavedFeedsInner({
currentFeeds.every(f => f.type !== 'timeline') && !noSavedFeedsOfAnyType currentFeeds.every(f => f.type !== 'timeline') && !noSavedFeedsOfAnyType
useFocusEffect( useFocusEffect(
React.useCallback(() => { useCallback(() => {
setMinimalShellMode(false) setMinimalShellMode(false)
}, [setMinimalShellMode]), }, [setMinimalShellMode]),
) )
const onSaveChanges = React.useCallback(async () => { const onSaveChanges = async () => {
try { try {
await overwriteSavedFeeds(currentFeeds) await overwriteSavedFeeds(currentFeeds)
Toast.show(_(msg({message: 'Feeds updated!', context: 'toast'}))) Toast.show(_(msg({message: 'Feeds updated!', context: 'toast'})))
@@ -93,7 +97,7 @@ function SavedFeedsInner({
Toast.show(_(msg`There was an issue contacting the server`), 'xmark') Toast.show(_(msg`There was an issue contacting the server`), 'xmark')
logger.error('Failed to toggle pinned feed', {message: e}) logger.error('Failed to toggle pinned feed', {message: e})
} }
}, [_, overwriteSavedFeeds, currentFeeds, navigation]) }
return ( return (
<Layout.Screen> <Layout.Screen>
@@ -107,43 +111,43 @@ function SavedFeedsInner({
<Button <Button
testID="saveChangesBtn" testID="saveChangesBtn"
size="small" size="small"
variant={hasUnsavedChanges ? 'solid' : 'solid'}
color={hasUnsavedChanges ? 'primary' : 'secondary'} color={hasUnsavedChanges ? 'primary' : 'secondary'}
onPress={onSaveChanges} onPress={onSaveChanges}
label={_(msg`Save changes`)} label={_(msg`Save changes`)}
disabled={isOverwritePending || !hasUnsavedChanges}> disabled={isOverwritePending || !hasUnsavedChanges}>
<ButtonIcon icon={isOverwritePending ? Loader : SaveIcon} /> <ButtonIcon icon={isOverwritePending ? Loader : SaveIcon} />
<ButtonText> <ButtonText>
{isDesktop ? <Trans>Save changes</Trans> : <Trans>Save</Trans>} {gtMobile ? <Trans>Save changes</Trans> : <Trans>Save</Trans>}
</ButtonText> </ButtonText>
</Button> </Button>
</Layout.Header.Outer> </Layout.Header.Outer>
<Layout.Content> <Layout.Content>
{noSavedFeedsOfAnyType && ( {noSavedFeedsOfAnyType && (
<View style={[pal.border, a.border_b]}> <View style={[t.atoms.border_contrast_low, a.border_b]}>
<NoSavedFeedsOfAnyType /> <NoSavedFeedsOfAnyType
onAddRecommendedFeeds={() =>
setCurrentFeeds(
RECOMMENDED_SAVED_FEEDS.map(f => ({
...f,
id: TID.nextStr(),
})),
)
}
/>
</View> </View>
)} )}
<View style={[pal.text, pal.border, styles.title]}> <SectionHeaderText>
<Text type="title" style={pal.text}>
<Trans>Pinned Feeds</Trans> <Trans>Pinned Feeds</Trans>
</Text> </SectionHeaderText>
</View>
{preferences ? ( {preferences ? (
!pinnedFeeds.length ? ( !pinnedFeeds.length ? (
<View <View style={[a.flex_1, a.p_lg]}>
style={[ <Admonition type="info">
pal.border,
isMobile && s.flex1,
pal.viewLight,
styles.empty,
]}>
<Text type="lg" style={[pal.text]}>
<Trans>You don't have any pinned feeds.</Trans> <Trans>You don't have any pinned feeds.</Trans>
</Text> </Admonition>
</View> </View>
) : ( ) : (
pinnedFeeds.map(f => ( pinnedFeeds.map(f => (
@@ -158,32 +162,34 @@ function SavedFeedsInner({
)) ))
) )
) : ( ) : (
<ActivityIndicator style={{marginTop: 20}} /> <View style={[a.w_full, a.py_2xl, a.align_center]}>
<Loader size="xl" />
</View>
)} )}
{noFollowingFeed && ( {noFollowingFeed && (
<View style={[pal.border, a.border_b]}> <View style={[t.atoms.border_contrast_low, a.border_b]}>
<NoFollowingFeed /> <NoFollowingFeed
onAddFeed={() =>
setCurrentFeeds(feeds => [
...feeds,
{...TIMELINE_SAVED_FEED, id: TID.next().toString()},
])
}
/>
</View> </View>
)} )}
<View style={[pal.text, pal.border, styles.title]}> <SectionHeaderText>
<Text type="title" style={pal.text}>
<Trans>Saved Feeds</Trans> <Trans>Saved Feeds</Trans>
</Text> </SectionHeaderText>
</View>
{preferences ? ( {preferences ? (
!unpinnedFeeds.length ? ( !unpinnedFeeds.length ? (
<View <View style={[a.flex_1, a.p_lg]}>
style={[ <Admonition type="info">
pal.border,
isMobile && s.flex1,
pal.viewLight,
styles.empty,
]}>
<Text type="lg" style={[pal.text]}>
<Trans>You don't have any saved feeds.</Trans> <Trans>You don't have any saved feeds.</Trans>
</Text> </Admonition>
</View> </View>
) : ( ) : (
unpinnedFeeds.map(f => ( unpinnedFeeds.map(f => (
@@ -198,20 +204,24 @@ function SavedFeedsInner({
)) ))
) )
) : ( ) : (
<ActivityIndicator style={{marginTop: 20}} /> <View style={[a.w_full, a.py_2xl, a.align_center]}>
<Loader size="xl" />
</View>
)} )}
<View style={styles.footerText}> <View style={[a.px_lg, a.py_xl]}>
<Text type="sm" style={pal.textLight}> <Text
style={[a.text_sm, t.atoms.text_contrast_medium, a.leading_snug]}>
<Trans> <Trans>
Feeds are custom algorithms that users build with a little coding Feeds are custom algorithms that users build with a little coding
expertise.{' '} expertise.{' '}
<TextLink <InlineLinkText
type="sm" to="https://github.com/bluesky-social/feed-generator"
style={pal.link} label={_(msg`See this guide`)}
href="https://github.com/bluesky-social/feed-generator" disableMismatchWarning
text={_(msg`See this guide`)} style={[a.leading_snug]}>
/>{' '} See this guide
</InlineLinkText>{' '}
for more information. for more information.
</Trans> </Trans>
</Text> </Text>
@@ -234,20 +244,20 @@ function ListItem({
preferences: UsePreferencesQueryResponse preferences: UsePreferencesQueryResponse
}) { }) {
const {_} = useLingui() const {_} = useLingui()
const pal = usePalette('default') const t = useTheme()
const playHaptic = useHaptics() const playHaptic = useHaptics()
const feedUri = feed.value const feedUri = feed.value
const onTogglePinned = React.useCallback(async () => { const onTogglePinned = async () => {
playHaptic() playHaptic()
setCurrentFeeds( setCurrentFeeds(
currentFeeds.map(f => currentFeeds.map(f =>
f.id === feed.id ? {...feed, pinned: !feed.pinned} : f, f.id === feed.id ? {...feed, pinned: !feed.pinned} : f,
), ),
) )
}, [playHaptic, feed, currentFeeds, setCurrentFeeds]) }
const onPressUp = React.useCallback(async () => { const onPressUp = async () => {
if (!isPinned) return if (!isPinned) return
const nextFeeds = currentFeeds.slice() const nextFeeds = currentFeeds.slice()
@@ -262,9 +272,9 @@ function ListItem({
] ]
setCurrentFeeds(nextFeeds) setCurrentFeeds(nextFeeds)
}, [feed, isPinned, setCurrentFeeds, currentFeeds]) }
const onPressDown = React.useCallback(async () => { const onPressDown = async () => {
if (!isPinned) return if (!isPinned) return
const nextFeeds = currentFeeds.slice() const nextFeeds = currentFeeds.slice()
@@ -280,16 +290,16 @@ function ListItem({
] ]
setCurrentFeeds(nextFeeds) setCurrentFeeds(nextFeeds)
}, [feed, isPinned, setCurrentFeeds, currentFeeds]) }
const onPressRemove = React.useCallback(async () => { const onPressRemove = async () => {
playHaptic() playHaptic()
setCurrentFeeds(currentFeeds.filter(f => f.id !== feed.id)) setCurrentFeeds(currentFeeds.filter(f => f.id !== feed.id))
}, [playHaptic, feed, currentFeeds, setCurrentFeeds]) }
return ( return (
<Animated.View <Animated.View
style={[styles.itemContainer, pal.border]} style={[a.flex_row, a.border_b, t.atoms.border_contrast_low]}
layout={LinearTransition.duration(100)}> layout={LinearTransition.duration(100)}>
{feed.type === 'timeline' ? ( {feed.type === 'timeline' ? (
<FollowingFeedCard /> <FollowingFeedCard />
@@ -302,93 +312,73 @@ function ListItem({
hideTopBorder={true} hideTopBorder={true}
/> />
)} )}
<View style={[a.pr_lg, a.flex_row, a.align_center, a.gap_sm]}>
{isPinned ? ( {isPinned ? (
<> <>
<Pressable <Button
accessibilityRole="button" testID={`feed-${feed.type}-moveUp`}
label={_(msg`Move feed up`)}
onPress={onPressUp} onPress={onPressUp}
hitSlop={5} size="small"
style={state => ({ color="secondary"
backgroundColor: pal.viewLight.backgroundColor, shape="square">
paddingHorizontal: 12, <ButtonIcon icon={ArrowUpIcon} />
paddingVertical: 10, </Button>
borderRadius: 4, <Button
marginRight: 8, testID={`feed-${feed.type}-moveDown`}
opacity: state.hovered || state.pressed ? 0.5 : 1, label={_(msg`Move feed down`)}
})}
testID={`feed-${feed.type}-moveUp`}>
<FontAwesomeIcon
icon="arrow-up"
size={14}
style={[pal.textLight]}
/>
</Pressable>
<Pressable
accessibilityRole="button"
onPress={onPressDown} onPress={onPressDown}
hitSlop={5} size="small"
style={state => ({ color="secondary"
backgroundColor: pal.viewLight.backgroundColor, shape="square">
paddingHorizontal: 12, <ButtonIcon icon={ArrowDownIcon} />
paddingVertical: 10, </Button>
borderRadius: 4,
marginRight: 8,
opacity: state.hovered || state.pressed ? 0.5 : 1,
})}
testID={`feed-${feed.type}-moveDown`}>
<FontAwesomeIcon
icon="arrow-down"
size={14}
style={[pal.textLight]}
/>
</Pressable>
</> </>
) : ( ) : (
<Pressable <Button
testID={`feed-${feedUri}-toggleSave`} testID={`feed-${feedUri}-toggleSave`}
accessibilityRole="button" label={_(msg`Remove from my feeds`)}
accessibilityLabel={_(msg`Remove from my feeds`)}
accessibilityHint=""
onPress={onPressRemove} onPress={onPressRemove}
hitSlop={5} size="small"
style={state => ({ color="secondary"
marginRight: 8, variant="ghost"
paddingHorizontal: 12, shape="square">
paddingVertical: 10, <ButtonIcon icon={TrashIcon} />
borderRadius: 4, </Button>
opacity: state.hovered || state.focused ? 0.5 : 1,
})}>
<FontAwesomeIcon
icon={['far', 'trash-can']}
size={19}
color={pal.colors.icon}
/>
</Pressable>
)} )}
<View style={{paddingRight: 16}}> <Button
<Pressable testID={`feed-${feed.type}-togglePin`}
accessibilityRole="button" label={isPinned ? _(msg`Unpin feed`) : _(msg`Pin feed`)}
hitSlop={5}
onPress={onTogglePinned} onPress={onTogglePinned}
style={state => ({ size="small"
backgroundColor: pal.viewLight.backgroundColor, color={isPinned ? 'primary_subtle' : 'secondary'}
paddingHorizontal: 12, shape="square">
paddingVertical: 10, <ButtonIcon icon={PinIcon} />
borderRadius: 4, </Button>
opacity: state.hovered || state.focused ? 0.5 : 1,
})}
testID={`feed-${feed.type}-togglePin`}>
<FontAwesomeIcon
icon="thumb-tack"
size={14}
color={isPinned ? colors.blue3 : pal.colors.icon}
/>
</Pressable>
</View> </View>
</Animated.View> </Animated.View>
) )
} }
function SectionHeaderText({children}: {children: React.ReactNode}) {
const t = useTheme()
// eslint-disable-next-line bsky-internal/avoid-unwrapped-text
return (
<View
style={[
a.flex_row,
a.flex_1,
a.px_lg,
a.pt_2xl,
a.pb_md,
a.border_b,
t.atoms.border_contrast_low,
]}>
<Text style={[a.text_xl, a.font_heavy, a.leading_snug]}>{children}</Text>
</View>
)
}
function FollowingFeedCard() { function FollowingFeedCard() {
const t = useTheme() const t = useTheme()
return ( return (
@@ -416,35 +406,10 @@ function FollowingFeedCard() {
/> />
</View> </View>
<View style={[a.flex_1, a.flex_row, a.gap_sm, a.align_center]}> <View style={[a.flex_1, a.flex_row, a.gap_sm, a.align_center]}>
<NewText style={[a.text_sm, a.font_bold, a.leading_snug]}> <Text style={[a.text_sm, a.font_bold, a.leading_snug]}>
<Trans context="feed-name">Following</Trans> <Trans context="feed-name">Following</Trans>
</NewText> </Text>
</View> </View>
</View> </View>
) )
} }
const styles = StyleSheet.create({
empty: {
paddingHorizontal: 20,
paddingVertical: 20,
borderRadius: 8,
marginHorizontal: 10,
marginTop: 10,
},
title: {
paddingHorizontal: 14,
paddingTop: 20,
paddingBottom: 10,
borderBottomWidth: StyleSheet.hairlineWidth,
},
itemContainer: {
flexDirection: 'row',
alignItems: 'center',
borderBottomWidth: StyleSheet.hairlineWidth,
},
footerText: {
paddingHorizontal: 26,
paddingVertical: 22,
},
})