diff options
Diffstat (limited to 'src/components/Error.tsx')
-rw-r--r-- | src/components/Error.tsx | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/components/Error.tsx b/src/components/Error.tsx index bf689fc07..ee479cca9 100644 --- a/src/components/Error.tsx +++ b/src/components/Error.tsx @@ -17,12 +17,14 @@ export function Error({ message, onRetry, onGoBack: onGoBackProp, + hideBackButton, sideBorders = true, }: { title?: string message?: string onRetry?: () => unknown onGoBack?: () => unknown + hideBackButton?: boolean sideBorders?: boolean }) { const navigation = useNavigation<NavigationProp>() @@ -89,17 +91,19 @@ export function Error({ </ButtonText> </Button> )} - <Button - variant="solid" - color={onRetry ? 'secondary' : 'primary'} - label={_(msg`Return to previous page`)} - onPress={onGoBack} - size="large" - style={[a.rounded_sm, a.overflow_hidden, {paddingVertical: 10}]}> - <ButtonText> - <Trans>Go Back</Trans> - </ButtonText> - </Button> + {!hideBackButton && ( + <Button + variant="solid" + color={onRetry ? 'secondary' : 'primary'} + label={_(msg`Return to previous page`)} + onPress={onGoBack} + size="large" + style={[a.rounded_sm, a.overflow_hidden, {paddingVertical: 10}]}> + <ButtonText> + <Trans>Go Back</Trans> + </ButtonText> + </Button> + )} </View> </CenteredView> ) |