An ATproto social media client -- with an independent Appview.
1import {View} from 'react-native'
2import {msg, Trans} from '@lingui/macro'
3import {useLingui} from '@lingui/react'
4
5import {atoms as a, useTheme} from '#/alf'
6import {Button, ButtonIcon, ButtonText} from '#/components/Button'
7import {ArrowRotateCounterClockwise_Stroke2_Corner0_Rounded as ArrowRotateIcon} from '#/components/icons/ArrowRotateCounterClockwise'
8import {MediaInsetBorder} from '#/components/MediaInsetBorder'
9import {Text as TypoText} from '#/components/Typography'
10
11export function Container({children}: {children: React.ReactNode}) {
12 const t = useTheme()
13 return (
14 <View
15 style={[
16 a.flex_1,
17 t.atoms.bg_contrast_25,
18 a.justify_center,
19 a.align_center,
20 a.px_lg,
21 a.rounded_md,
22 a.overflow_hidden,
23 a.gap_lg,
24 ]}>
25 {children}
26 <MediaInsetBorder />
27 </View>
28 )
29}
30
31export function Text({children}: {children: React.ReactNode}) {
32 const t = useTheme()
33 return (
34 <TypoText
35 style={[
36 a.text_center,
37 t.atoms.text_contrast_high,
38 a.text_md,
39 a.leading_snug,
40 {maxWidth: 300},
41 ]}>
42 {children}
43 </TypoText>
44 )
45}
46
47export function RetryButton({onPress}: {onPress: () => void}) {
48 const {_} = useLingui()
49
50 return (
51 <Button
52 onPress={onPress}
53 size="small"
54 color="secondary_inverted"
55 label={_(msg`Retry`)}>
56 <ButtonIcon icon={ArrowRotateIcon} />
57 <ButtonText>
58 <Trans>Retry</Trans>
59 </ButtonText>
60 </Button>
61 )
62}