use button instead of TextLink for show more

This commit is contained in:
Samuel Newman
2025-06-12 14:05:17 +03:00
parent a26b20b56c
commit 7ec4d7b1d5
7 changed files with 61 additions and 72 deletions
+31
View File
@@ -0,0 +1,31 @@
import {useCallback} from 'react'
import {LayoutAnimation} from 'react-native'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {HITSLOP_10} from '#/lib/constants'
import {atoms as a} from '#/alf'
import {Button, ButtonText} from '#/components/Button'
export function ShowMore({onPress: onPressProp}: {onPress: () => void}) {
const {_} = useLingui()
const onPress = useCallback(() => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)
onPressProp()
}, [onPressProp])
return (
<Button
label={_(msg`Expand post text`)}
onPress={onPress}
color="primary"
variant="ghost"
style={[a.self_start, a.my_xs, a.rounded_2xs]}
hitSlop={HITSLOP_10}>
<ButtonText>
<Trans>Show More</Trans>
</ButtonText>
</Button>
)
}