Skip to content

Commit

Permalink
Fix not found page showing close
Browse files Browse the repository at this point in the history
  • Loading branch information
iwiznia committed Sep 30, 2022
1 parent 3cd6b55 commit 713e5a4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/components/BlockingViews/FullPageNotFoundView.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,24 @@ const propTypes = {

/** The key in the translations file to use for the subtitle */
subtitleKey: PropTypes.string,

/** Whether we should show a back icon */
shouldShowBackButton: PropTypes.bool,

/** Whether we should show a close button */
shouldShowCloseButton: PropTypes.bool,

/** Method to trigger when pressing the back button of the header */
onBackButtonPress: PropTypes.func,
};

const defaultProps = {
shouldShow: false,
titleKey: 'notFound.notHere',
subtitleKey: 'notFound.pageNotFound',
shouldShowBackButton: true,
shouldShowCloseButton: true,
onBackButtonPress: () => Navigation.dismissModal(),
};

// eslint-disable-next-line rulesdir/no-negated-variables
Expand All @@ -38,8 +50,9 @@ const FullPageNotFoundView = (props) => {
return (
<>
<HeaderWithCloseButton
shouldShowBackButton
onBackButtonPress={() => Navigation.dismissModal()}
shouldShowBackButton={props.shouldShowBackButton}
shouldShowCloseButton={props.shouldShowCloseButton}
onBackButtonPress={props.onBackButtonPress}
onCloseButtonPress={() => Navigation.dismissModal()}
/>
<View style={styles.flex1}>
Expand Down
5 changes: 5 additions & 0 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ class ReportScreen extends React.Component {
<FullPageNotFoundView
shouldShow={!this.props.report.reportID}
subtitleKey="notFound.noAccess"
shouldShowCloseButton={false}
shouldShowBackButton={this.props.isSmallScreenWidth}
onBackButtonPress={() => {
Navigation.navigate(ROUTES.HOME);
}}
>
<OfflineWithFeedback
pendingAction={addWorkspaceRoomPendingAction}
Expand Down

0 comments on commit 713e5a4

Please sign in to comment.