|
1 | | -import { Button, Host, ProgressView, Text, VStack } from '@expo/ui/swift-ui'; |
2 | | -import { font, foregroundStyle, multilineTextAlignment } from '@expo/ui/swift-ui/modifiers'; |
| 1 | +import { Button, Host, Image, ProgressView, Text, VStack } from '@expo/ui/swift-ui'; |
| 2 | +import { |
| 3 | + buttonStyle, |
| 4 | + font, |
| 5 | + multilineTextAlignment, |
| 6 | + textSelection, |
| 7 | +} from '@expo/ui/swift-ui/modifiers'; |
| 8 | +import { FOOTNOTE, SECONDARY } from '@mobile/components/form/styles'; |
3 | 9 | import { useTranslations } from 'use-intl'; |
4 | 10 |
|
5 | | -const SECONDARY = foregroundStyle({ type: 'hierarchical', style: 'secondary' }); |
6 | | -const FOOTNOTE = font({ textStyle: 'footnote' }); |
| 11 | +const CENTERED = multilineTextAlignment('center'); |
| 12 | +const TITLE = font({ textStyle: 'title2', weight: 'semibold' }); |
7 | 13 |
|
8 | 14 | export interface HostConnectionStateProps { |
9 | 15 | status: 'connecting' | 'error'; |
@@ -32,13 +38,24 @@ export function HostConnectionState({ |
32 | 38 | </> |
33 | 39 | ) : ( |
34 | 40 | <> |
35 | | - <Text modifiers={[multilineTextAlignment('center')]}>{t('error', { url })}</Text> |
| 41 | + <Image systemName="wifi.exclamationmark" size={44} modifiers={[SECONDARY]} /> |
| 42 | + <VStack spacing={6}> |
| 43 | + <Text modifiers={[TITLE, CENTERED]}>{t('unavailableTitle')}</Text> |
| 44 | + <Text modifiers={[SECONDARY, CENTERED, textSelection(true)]}> |
| 45 | + {t('error', { url })} |
| 46 | + </Text> |
| 47 | + </VStack> |
| 48 | + <Button |
| 49 | + label={t('retry')} |
| 50 | + systemImage="arrow.clockwise" |
| 51 | + modifiers={[buttonStyle('borderedProminent')]} |
| 52 | + onPress={onRetry} |
| 53 | + /> |
36 | 54 | {failure ? ( |
37 | | - <Text modifiers={[FOOTNOTE, SECONDARY, multilineTextAlignment('center')]}> |
| 55 | + <Text modifiers={[FOOTNOTE, SECONDARY, CENTERED, textSelection(true)]}> |
38 | 56 | {failure} |
39 | 57 | </Text> |
40 | 58 | ) : null} |
41 | | - <Button label={t('retry')} onPress={onRetry} /> |
42 | 59 | </> |
43 | 60 | )} |
44 | 61 | </VStack> |
|
0 commit comments