From 44aa424c92e2860c1a2e55c0173e80240724b847 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 20 Feb 2026 12:28:26 +0200 Subject: [PATCH] Finish ALFing up ErrorScreen --- .../warning_stroke2_corner2_rounded_large.svg | 1 + src/components/icons/Warning.tsx | 5 +++ src/components/icons/common.tsx | 1 + src/view/com/util/error/ErrorMessage.tsx | 5 +++ src/view/com/util/error/ErrorScreen.tsx | 43 +++++++------------ 5 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 assets/icons/warning_stroke2_corner2_rounded_large.svg diff --git a/assets/icons/warning_stroke2_corner2_rounded_large.svg b/assets/icons/warning_stroke2_corner2_rounded_large.svg new file mode 100644 index 0000000000..6e27775f9e --- /dev/null +++ b/assets/icons/warning_stroke2_corner2_rounded_large.svg @@ -0,0 +1 @@ + diff --git a/src/components/icons/Warning.tsx b/src/components/icons/Warning.tsx index fc84b28945..1a1deb00a1 100644 --- a/src/components/icons/Warning.tsx +++ b/src/components/icons/Warning.tsx @@ -3,3 +3,8 @@ import {createSinglePathSVG} from './TEMPLATE' export const Warning_Stroke2_Corner0_Rounded = createSinglePathSVG({ path: 'M11.14 4.494a.995.995 0 0 1 1.72 0l7.001 12.008a.996.996 0 0 1-.86 1.498H4.999a.996.996 0 0 1-.86-1.498L11.14 4.494Zm3.447-1.007c-1.155-1.983-4.019-1.983-5.174 0L2.41 15.494C1.247 17.491 2.686 20 4.998 20h14.004c2.312 0 3.751-2.509 2.587-4.506L14.587 3.487ZM13 9.019a1 1 0 1 0-2 0v2.994a1 1 0 1 0 2 0V9.02Zm-1 4.731a1.25 1.25 0 1 0 0 2.5 1.25 1.25 0 0 0 0-2.5Z', }) + +export const Warning_Stroke2_Corner0_Rounded_Large = createSinglePathSVG({ + viewBox: '0 0 64 64', + path: 'M26.108 9.886c2.632-4.514 9.152-4.514 11.784 0l18.671 32.02v0c2.651 4.548-.627 10.261-5.892 10.261H13.329c-5.265 0-8.543-5.713-5.892-10.26v-.002l18.671-32.02Zm9.192 1.51c-1.474-2.528-5.125-2.528-6.6 0L10.028 43.418c-1.486 2.55.353 5.75 3.301 5.75h37.342c2.948 0 4.787-3.2 3.3-5.75L35.3 11.397ZM32 36.834a2.167 2.167 0 1 1 0 4.334 2.167 2.167 0 0 1 0-4.334Zm-1.5-3.797v-7.985a1.5 1.5 0 0 1 3 0v7.985a1.5 1.5 0 0 1-3 0Z', +}) diff --git a/src/components/icons/common.tsx b/src/components/icons/common.tsx index 46df59207c..448808f830 100644 --- a/src/components/icons/common.tsx +++ b/src/components/icons/common.tsx @@ -21,6 +21,7 @@ export const sizes = { xl: 28, '2xl': 32, '3xl': 48, + '4xl': 64, } as const export function useCommonSVGProps(props: Props) { diff --git a/src/view/com/util/error/ErrorMessage.tsx b/src/view/com/util/error/ErrorMessage.tsx index 529406996c..1de346dafd 100644 --- a/src/view/com/util/error/ErrorMessage.tsx +++ b/src/view/com/util/error/ErrorMessage.tsx @@ -17,6 +17,11 @@ import {useTheme} from '#/lib/ThemeContext' import * as Layout from '#/components/Layout' import {Text} from '../text/Text' +/** + * @deprecated - use Admonition with type="error" instead (does not cover all cases) + * + * TODO: Create a new ALF'd component -sfn + */ export function ErrorMessage({ message, numberOfLines, diff --git a/src/view/com/util/error/ErrorScreen.tsx b/src/view/com/util/error/ErrorScreen.tsx index 177fa9fb9a..fca79be322 100644 --- a/src/view/com/util/error/ErrorScreen.tsx +++ b/src/view/com/util/error/ErrorScreen.tsx @@ -1,15 +1,11 @@ import {View} from 'react-native' -import { - FontAwesomeIcon, - type FontAwesomeIconStyle, -} from '@fortawesome/react-native-fontawesome' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' -import {usePalette} from '#/lib/hooks/usePalette' import {atoms as a, useTheme} from '#/alf' import {Button, ButtonIcon, ButtonText} from '#/components/Button' import {ArrowRotateCounterClockwise_Stroke2_Corner0_Rounded as ArrowRotateCounterClockwiseIcon} from '#/components/icons/ArrowRotate' +import {Warning_Stroke2_Corner0_Rounded_Large as WarningIcon} from '#/components/icons/Warning' import * as Layout from '#/components/Layout' import {Text} from '#/components/Typography' @@ -29,7 +25,6 @@ export function ErrorScreen({ showHeader?: boolean }) { const t = useTheme() - const pal = usePalette('default') const {_} = useLingui() return ( @@ -45,27 +40,22 @@ export function ErrorScreen({ )} - - - - - + + + - + {title} - {message} + + {message} + {details && (