Skip to content

Commit

Permalink
Merge pull request #46479 from bernhardoj/fix/46183-back-button-overlaps
Browse files Browse the repository at this point in the history
Fix back button overlaps with status bar in workspace not found page
  • Loading branch information
Julesssss authored Jul 30, 2024
2 parents 9d1103e + 8d4dca5 commit 75be218
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/pages/workspace/AccessOrNotFoundWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React, {useEffect, useState} from 'react';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import type {FullPageNotFoundViewProps} from '@components/BlockingViews/FullPageNotFoundView';
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
import FullscreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useNetwork from '@hooks/useNetwork';
Expand Down Expand Up @@ -87,17 +86,16 @@ type AccessOrNotFoundWrapperProps = AccessOrNotFoundWrapperOnyxProps & {
type PageNotFoundFallbackProps = Pick<AccessOrNotFoundWrapperProps, 'policyID' | 'fullPageNotFoundViewProps'> & {shouldShowFullScreenFallback: boolean; isMoneyRequest: boolean};

function PageNotFoundFallback({policyID, shouldShowFullScreenFallback, fullPageNotFoundViewProps, isMoneyRequest}: PageNotFoundFallbackProps) {
return shouldShowFullScreenFallback ? (
<FullPageNotFoundView
shouldShow
onBackButtonPress={() => Navigation.dismissModal()}
shouldForceFullScreen
// eslint-disable-next-line react/jsx-props-no-spreading
{...fullPageNotFoundViewProps}
/>
) : (
return (
<NotFoundPage
onBackButtonPress={() => Navigation.goBack(policyID && !isMoneyRequest ? ROUTES.WORKSPACE_PROFILE.getRoute(policyID) : undefined)}
shouldForceFullScreen={shouldShowFullScreenFallback}
onBackButtonPress={() => {
if (shouldShowFullScreenFallback) {
Navigation.dismissModal();
return;
}
Navigation.goBack(policyID && !isMoneyRequest ? ROUTES.WORKSPACE_PROFILE.getRoute(policyID) : undefined);
}}
// eslint-disable-next-line react/jsx-props-no-spreading
{...fullPageNotFoundViewProps}
/>
Expand Down

0 comments on commit 75be218

Please sign in to comment.