Something went wrong. Try again.
cee sky
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465import {useCallback, useMemo} from 'react'import { type GestureResponderEvent, LayoutAnimation, type TextStyle,} from 'react-native'import {Trans, useLingui} from '@lingui/react/macro'
import {HITSLOP_10} from '#/lib/constants'import {atoms as a, flatten, type TextStyleProp, useTheme} from '#/alf'import {Button} from '#/components/Button'import {Text} from '#/components/Typography'
export function ShowMoreTextButton({ onPress: onPressProp, style,}: TextStyleProp & { onPress: (event: GestureResponderEvent) => void}) { const t = useTheme() const {t: l} = useLingui()
const onPress = useCallback( (event: GestureResponderEvent) => { LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut) onPressProp(event) }, [onPressProp], )
const textStyle = useMemo(() => { return flatten([a.leading_snug, a.text_sm, style]) as TextStyle & { fontSize: number lineHeight: number } }, [style])
return ( <Button label={l`Expand post text`} onPress={onPress} style={[ a.self_start, { paddingBottom: textStyle.fontSize / 3, }, ]} hitSlop={HITSLOP_10}> {({pressed, hovered}) => ( <Text style={[ textStyle, t.atoms.text_link, { opacity: pressed ? 0.6 : 1, textDecorationLine: hovered ? 'underline' : undefined, }, ]}> <Trans>Show more</Trans> </Text> )} </Button> )}