mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
at samuel/exp-cli 62 lines 1.7 kB view raw
1import {View} from 'react-native' 2import {msg} from '@lingui/macro' 3import {useLingui} from '@lingui/react' 4 5import {atoms as a, useTheme} from '#/alf' 6import {Button} from '#/components/Button' 7import {EyeSlash_Stroke2_Corner0_Rounded as EyeSlash} from '#/components/icons/EyeSlash' 8import {Text} from '#/components/Typography' 9 10export function PostThreadShowHiddenReplies({ 11 type, 12 onPress, 13 hideTopBorder, 14}: { 15 type: 'hidden' | 'muted' 16 onPress: () => void 17 hideTopBorder?: boolean 18}) { 19 const {_} = useLingui() 20 const t = useTheme() 21 const label = 22 type === 'muted' ? _(msg`Show muted replies`) : _(msg`Show hidden replies`) 23 24 return ( 25 <Button onPress={onPress} label={label}> 26 {({hovered, pressed}) => ( 27 <View 28 style={[ 29 a.flex_1, 30 a.flex_row, 31 a.align_center, 32 a.gap_sm, 33 a.py_lg, 34 a.px_xl, 35 !hideTopBorder && a.border_t, 36 t.atoms.border_contrast_low, 37 hovered || pressed ? t.atoms.bg_contrast_25 : t.atoms.bg, 38 ]}> 39 <View 40 style={[ 41 t.atoms.bg_contrast_25, 42 a.align_center, 43 a.justify_center, 44 { 45 width: 26, 46 height: 26, 47 borderRadius: 13, 48 marginRight: 4, 49 }, 50 ]}> 51 <EyeSlash size="sm" fill={t.atoms.text_contrast_medium.color} /> 52 </View> 53 <Text 54 style={[t.atoms.text_contrast_medium, a.flex_1, a.leading_snug]} 55 numberOfLines={1}> 56 {label} 57 </Text> 58 </View> 59 )} 60 </Button> 61 ) 62}