Bluesky app fork with some witchin' additions 馃挮
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at cope-settings-sync 84 lines 2.3 kB view raw
1import {View} from 'react-native' 2import {msg} from '@lingui/core/macro' 3import {useLingui} from '@lingui/react' 4import {Trans} from '@lingui/react/macro' 5 6import {useGoBack} from '#/lib/hooks/useGoBack' 7import {CenteredView} from '#/view/com/util/Views' 8import {atoms as a, useBreakpoints, useTheme} from '#/alf' 9import {Button, ButtonText} from '#/components/Button' 10import {Text} from '#/components/Typography' 11 12export function Error({ 13 title, 14 message, 15 onRetry, 16 onGoBack, 17 hideBackButton, 18 sideBorders = true, 19}: { 20 title?: string 21 message?: string 22 onRetry?: () => unknown 23 onGoBack?: () => unknown 24 hideBackButton?: boolean 25 sideBorders?: boolean 26}) { 27 const {_} = useLingui() 28 const t = useTheme() 29 const {gtMobile} = useBreakpoints() 30 const goBack = useGoBack(onGoBack) 31 32 return ( 33 <CenteredView 34 style={[ 35 a.h_full_vh, 36 a.align_center, 37 a.gap_5xl, 38 !gtMobile && a.justify_between, 39 t.atoms.border_contrast_low, 40 {paddingTop: 175, paddingBottom: 110}, 41 ]} 42 sideBorders={sideBorders}> 43 <View style={[a.w_full, a.align_center, a.gap_lg]}> 44 <Text style={[a.font_semi_bold, a.text_3xl]}>{title}</Text> 45 <Text 46 style={[ 47 a.text_md, 48 a.text_center, 49 t.atoms.text_contrast_high, 50 {lineHeight: 1.4}, 51 gtMobile ? {width: 450} : [a.w_full, a.px_lg], 52 ]}> 53 {message} 54 </Text> 55 </View> 56 <View style={[a.gap_md, gtMobile ? {width: 350} : [a.w_full, a.px_lg]]}> 57 {onRetry && ( 58 <Button 59 variant="solid" 60 color="primary" 61 label={_(msg`Press to retry`)} 62 onPress={onRetry} 63 size="large"> 64 <ButtonText> 65 <Trans>Retry</Trans> 66 </ButtonText> 67 </Button> 68 )} 69 {!hideBackButton && ( 70 <Button 71 variant="solid" 72 color={onRetry ? 'secondary' : 'primary'} 73 label={_(msg`Return to previous page`)} 74 onPress={goBack} 75 size="large"> 76 <ButtonText> 77 <Trans>Go Back</Trans> 78 </ButtonText> 79 </Button> 80 )} 81 </View> 82 </CenteredView> 83 ) 84}