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