diff options
author | Hailey <me@haileyok.com> | 2024-02-08 12:01:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-08 12:01:36 -0800 |
commit | 1de1d10cf6b823f075112f8f938963c95b7fd3ba (patch) | |
tree | fceff40ee49a96167b858938d4dc75790d6b7130 /src/view/screens/Profile.tsx | |
parent | 4041db31e23fef216b93aa3b6e312836b7146b90 (diff) | |
download | voidsky-1de1d10cf6b823f075112f8f938963c95b7fd3ba.tar.zst |
Fix error screen on native, use `Not Found` for profile errors instead of `Oops!` (#2789)
* remove unnecessary `<CenterView>` * show back header on profile error * use `Not Found` instead of `Oops` for account errors * use `Not Found` instead of `Oops` for account errors
Diffstat (limited to 'src/view/screens/Profile.tsx')
-rw-r--r-- | src/view/screens/Profile.tsx | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx index 6d0f15d81..cc54ad3b2 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -50,6 +50,7 @@ interface SectionRef { type Props = NativeStackScreenProps<CommonNavigatorParams, 'Profile'> export function ProfileScreen({route}: Props) { + const {_} = useLingui() const {currentAccount} = useSession() const name = route.params.name === 'me' ? currentAccount?.did : route.params.name @@ -97,14 +98,13 @@ export function ProfileScreen({route}: Props) { } if (resolveError || profileError) { return ( - <CenteredView> - <ErrorScreen - testID="profileErrorScreen" - title="Oops!" - message={cleanError(resolveError || profileError)} - onPressTryAgain={onPressTryAgain} - /> - </CenteredView> + <ErrorScreen + testID="profileErrorScreen" + title={profileError ? _(msg`Not Found`) : _(msg`Oops!`)} + message={cleanError(resolveError || profileError)} + onPressTryAgain={onPressTryAgain} + showHeader + /> ) } if (profile && moderationOpts) { @@ -118,14 +118,13 @@ export function ProfileScreen({route}: Props) { } // should never happen return ( - <CenteredView> - <ErrorScreen - testID="profileErrorScreen" - title="Oops!" - message="Something went wrong and we're not sure what." - onPressTryAgain={onPressTryAgain} - /> - </CenteredView> + <ErrorScreen + testID="profileErrorScreen" + title="Oops!" + message="Something went wrong and we're not sure what." + onPressTryAgain={onPressTryAgain} + showHeader + /> ) } |