diff --git a/src/view/com/util/error/ErrorMessage.tsx b/src/view/com/util/error/ErrorMessage.tsx index f11cd77038..3463c70617 100644 --- a/src/view/com/util/error/ErrorMessage.tsx +++ b/src/view/com/util/error/ErrorMessage.tsx @@ -1,21 +1,12 @@ -import { - type StyleProp, - StyleSheet, - TouchableOpacity, - View, - type ViewStyle, -} from 'react-native' -import { - FontAwesomeIcon, - type FontAwesomeIconStyle, -} from '@fortawesome/react-native-fontawesome' -import {msg} from '@lingui/core/macro' -import {useLingui} from '@lingui/react' +import {type StyleProp, View, type ViewStyle} from 'react-native' +import {useLingui} from '@lingui/react/macro' -import {usePalette} from '#/lib/hooks/usePalette' -import {useTheme} from '#/lib/ThemeContext' +import {atoms as a, useGutters, useTheme, utils} from '#/alf' +import {Button} from '#/components/Button' +import {ArrowRotateClockwise_Stroke2_Corner0_Rounded as ArrowRotateIcon} from '#/components/icons/ArrowRotate' +import {Warning_Stroke2_Corner0_Rounded as WarningIcon} from '#/components/icons/Warning' import * as Layout from '#/components/Layout' -import {Text} from '../text/Text' +import {Text} from '#/components/Typography' export function ErrorMessage({ message, @@ -28,72 +19,51 @@ export function ErrorMessage({ style?: StyleProp onPressTryAgain?: () => void }) { - const theme = useTheme() - const pal = usePalette('error') - const {_} = useLingui() + const {t: l} = useLingui() + const t = useTheme() + const gutter = useGutters(['base']) + return ( - - - - + + {message} {onPressTryAgain && ( - - - + label={l`Retry`} + accessibilityHint={l`Retries the last action, which errored out`} + size="small" + shape="round" + variant="ghost" + hoverStyle={{ + backgroundColor: utils.alpha(t.palette.white, 0.2), + }}> + + )} ) } - -const styles = StyleSheet.create({ - outer: { - flexDirection: 'row', - alignItems: 'center', - paddingVertical: 8, - paddingHorizontal: 8, - }, - errorIcon: { - borderRadius: 12, - width: 24, - height: 24, - alignItems: 'center', - justifyContent: 'center', - marginRight: 8, - }, - message: { - flex: 1, - paddingRight: 10, - }, - btn: { - paddingHorizontal: 4, - paddingVertical: 4, - }, -})