add safe area view to profile error screen (#7134)

This commit is contained in:
Samuel Newman
2024-12-17 00:02:56 +00:00
committed by GitHub
parent de97c07c63
commit 1a160df396
+19 -14
View File
@@ -1,5 +1,6 @@
import React, {useCallback, useMemo} from 'react' import React, {useCallback, useMemo} from 'react'
import {StyleSheet} from 'react-native' import {StyleSheet} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'
import { import {
AppBskyActorDefs, AppBskyActorDefs,
AppBskyGraphGetActorStarterPacks, AppBskyGraphGetActorStarterPacks,
@@ -122,13 +123,15 @@ function ProfileScreenInner({route}: Props) {
} }
if (resolveError || profileError) { if (resolveError || profileError) {
return ( return (
<ErrorScreen <SafeAreaView style={[a.flex_1]}>
testID="profileErrorScreen" <ErrorScreen
title={profileError ? _(msg`Not Found`) : _(msg`Oops!`)} testID="profileErrorScreen"
message={cleanError(resolveError || profileError)} title={profileError ? _(msg`Not Found`) : _(msg`Oops!`)}
onPressTryAgain={onPressTryAgain} message={cleanError(resolveError || profileError)}
showHeader onPressTryAgain={onPressTryAgain}
/> showHeader
/>
</SafeAreaView>
) )
} }
if (profile && moderationOpts) { if (profile && moderationOpts) {
@@ -144,13 +147,15 @@ function ProfileScreenInner({route}: Props) {
} }
// should never happen // should never happen
return ( return (
<ErrorScreen <SafeAreaView style={[a.flex_1]}>
testID="profileErrorScreen" <ErrorScreen
title="Oops!" testID="profileErrorScreen"
message="Something went wrong and we're not sure what." title="Oops!"
onPressTryAgain={onPressTryAgain} message="Something went wrong and we're not sure what."
showHeader onPressTryAgain={onPressTryAgain}
/> showHeader
/>
</SafeAreaView>
) )
} }