Skip to content

Commit

Permalink
add safe area view to profile error screen
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzius committed Dec 16, 2024
1 parent de97c07 commit b197e69
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions src/view/screens/Profile.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, {useCallback, useMemo} from 'react'
import {StyleSheet} from 'react-native'
import {SafeAreaView} from 'react-native-safe-area-context'
import {
AppBskyActorDefs,
AppBskyGraphGetActorStarterPacks,
Expand Down Expand Up @@ -122,13 +123,15 @@ function ProfileScreenInner({route}: Props) {
}
if (resolveError || profileError) {
return (
<ErrorScreen
testID="profileErrorScreen"
title={profileError ? _(msg`Not Found`) : _(msg`Oops!`)}
message={cleanError(resolveError || profileError)}
onPressTryAgain={onPressTryAgain}
showHeader
/>
<SafeAreaView style={[a.flex_1]}>
<ErrorScreen
testID="profileErrorScreen"
title={profileError ? _(msg`Not Found`) : _(msg`Oops!`)}
message={cleanError(resolveError || profileError)}
onPressTryAgain={onPressTryAgain}
showHeader
/>
</SafeAreaView>
)
}
if (profile && moderationOpts) {
Expand All @@ -144,13 +147,15 @@ function ProfileScreenInner({route}: Props) {
}
// should never happen
return (
<ErrorScreen
testID="profileErrorScreen"
title="Oops!"
message="Something went wrong and we're not sure what."
onPressTryAgain={onPressTryAgain}
showHeader
/>
<SafeAreaView style={[a.flex_1]}>
<ErrorScreen
testID="profileErrorScreen"
title="Oops!"
message="Something went wrong and we're not sure what."
onPressTryAgain={onPressTryAgain}
showHeader
/>
</SafeAreaView>
)
}

Expand Down

0 comments on commit b197e69

Please sign in to comment.