convert CustomFeedEmptyState to ALF Button

This commit is contained in:
Samuel Newman
2026-05-18 16:47:43 +03:00
parent c6650a315a
commit 18a6e83a27
+17 -38
View File
@@ -1,10 +1,6 @@
import {useCallback, useEffect, useRef} from 'react' import {useCallback, useEffect, useRef} from 'react'
import {StyleSheet, View} from 'react-native' import {StyleSheet, View} from 'react-native'
import { import {Trans, useLingui} from '@lingui/react/macro'
FontAwesomeIcon,
type FontAwesomeIconStyle,
} from '@fortawesome/react-native-fontawesome'
import {Trans} from '@lingui/react/macro'
import {useNavigation} from '@react-navigation/native' import {useNavigation} from '@react-navigation/native'
import {DISCOVER_FEED_URI} from '#/lib/constants' import {DISCOVER_FEED_URI} from '#/lib/constants'
@@ -14,9 +10,11 @@ import {type NavigationProp} from '#/lib/routes/types'
import {s} from '#/lib/styles' import {s} from '#/lib/styles'
import {useFeedFeedbackContext} from '#/state/feed-feedback' import {useFeedFeedbackContext} from '#/state/feed-feedback'
import {useSession} from '#/state/session' import {useSession} from '#/state/session'
import {atoms as a} from '#/alf'
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
import {ChevronRight_Stroke2_Corner0_Rounded as ChevronRightIcon} from '#/components/icons/Chevron'
import {useAnalytics} from '#/analytics' import {useAnalytics} from '#/analytics'
import {IS_WEB} from '#/env' import {IS_WEB} from '#/env'
import {Button} from '../util/forms/Button'
import {Text} from '../util/text/Text' import {Text} from '../util/text/Text'
export function CustomFeedEmptyState() { export function CustomFeedEmptyState() {
@@ -40,8 +38,8 @@ export function CustomFeedEmptyState() {
} }
} }
}, [feedFeedback.feedSourceInfo, currentAccount?.did]) }, [feedFeedback.feedSourceInfo, currentAccount?.did])
const {t: l} = useLingui()
const pal = usePalette('default') const pal = usePalette('default')
const palInverted = usePalette('inverted')
const navigation = useNavigation<NavigationProp>() const navigation = useNavigation<NavigationProp>()
const onPressFindAccounts = useCallback(() => { const onPressFindAccounts = useCallback(() => {
@@ -64,19 +62,18 @@ export function CustomFeedEmptyState() {
language settings. language settings.
</Trans> </Trans>
</Text> </Text>
<Button <View style={[a.mt_xl, a.align_center]}>
type="inverted" <Button
style={styles.emptyBtn} label={l`Find accounts to follow`}
onPress={onPressFindAccounts}> onPress={onPressFindAccounts}
<Text type="lg-medium" style={palInverted.text}> color="secondary_inverted"
<Trans>Find accounts to follow</Trans> size="large">
</Text> <ButtonText>
<FontAwesomeIcon <Trans>Find accounts to follow</Trans>
icon="angle-right" </ButtonText>
style={palInverted.text as FontAwesomeIconStyle} <ButtonIcon icon={ChevronRightIcon} />
size={14} </Button>
/> </View>
</Button>
</View> </View>
) )
} }
@@ -93,22 +90,4 @@ const styles = StyleSheet.create({
marginLeft: 'auto', marginLeft: 'auto',
marginRight: 'auto', marginRight: 'auto',
}, },
emptyBtn: {
marginVertical: 20,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingVertical: 18,
paddingHorizontal: 24,
borderRadius: 30,
},
feedsTip: {
position: 'absolute',
left: 22,
},
feedsTipArrow: {
marginLeft: 32,
marginTop: 8,
},
}) })