forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1import {View} from 'react-native'
2import {Trans} from '@lingui/react/macro'
3
4import {atoms as a, useTheme} from '#/alf'
5import {Button, type ButtonProps} from '#/components/Button'
6import {Text} from '#/components/Typography'
7
8export function EditTextButton({
9 children,
10 style,
11 onPress,
12 ...props
13}: ButtonProps & {value: string}) {
14 const t = useTheme()
15
16 return (
17 <View style={[a.relative]}>
18 <Button
19 color="secondary"
20 style={[
21 a.flex_1,
22 a.justify_between,
23 a.rounded_full,
24 a.border,
25 t.atoms.bg,
26 t.atoms.border_contrast_low,
27 style,
28 ]}
29 onPress={onPress}
30 {...props}>
31 {context => (
32 <View
33 style={[
34 a.flex_1,
35 a.flex_row,
36 a.align_center,
37 a.justify_between,
38 a.px_md,
39 a.py_sm,
40 ]}>
41 {typeof children === 'function' ? children(context) : children}
42 <View
43 style={[
44 a.ml_sm,
45 a.rounded_full,
46 t.atoms.bg_contrast_50,
47 {paddingHorizontal: 10, paddingVertical: 8},
48 ]}>
49 <Text
50 style={[a.text_xs, a.font_medium, t.atoms.text_contrast_high]}>
51 <Trans>Edit</Trans>
52 </Text>
53 </View>
54 </View>
55 )}
56 </Button>
57 </View>
58 )
59}