Skip to content

Commit

Permalink
add notfound page
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Feb 21, 2024
1 parent bcce89b commit 20a749a
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/pages/settings/Report/VisibilityPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type {StackScreenProps} from '@react-navigation/stack';
import React, {useCallback, useMemo, useState} from 'react';
import {withOnyx} from 'react-native-onyx';
import type {OnyxEntry} from 'react-native-onyx';
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
import ConfirmModal from '@components/ConfirmModal';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
Expand All @@ -10,18 +8,14 @@ import SelectionList from '@components/SelectionList';
import useLocalize from '@hooks/useLocalize';
import type {ReportSettingsNavigatorParamList} from '@libs/Navigation/types';
import * as ReportUtils from '@libs/ReportUtils';
import type {WithReportOrNotFoundProps} from '@pages/home/report/withReportOrNotFound';
import withReportOrNotFound from '@pages/home/report/withReportOrNotFound';
import * as ReportActions from '@userActions/Report';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type SCREENS from '@src/SCREENS';
import type {Report} from '@src/types/onyx';
import type {RoomVisibility} from '@src/types/onyx/Report';

type VisibilityOnyxProps = {
report: OnyxEntry<Report>;
};

type VisibilityProps = VisibilityOnyxProps & StackScreenProps<ReportSettingsNavigatorParamList, typeof SCREENS.REPORT_SETTINGS.VISIBILITY>;
type VisibilityProps = WithReportOrNotFoundProps & StackScreenProps<ReportSettingsNavigatorParamList, typeof SCREENS.REPORT_SETTINGS.VISIBILITY>;

function VisibilityPage({report}: VisibilityProps) {
const [showConfirmModal, setShowConfirmModal] = useState(false);
Expand Down Expand Up @@ -68,6 +62,7 @@ function VisibilityPage({report}: VisibilityProps) {
onBackButtonPress={() => ReportUtils.goBackToDetailsPage(report)}
/>
<SelectionList
shouldPreventDefaultFocusOnSelectRow
sections={[{data: visibilityOptions}]}
onSelectRow={(option) => {
if (option.value === CONST.REPORT.VISIBILITY.PUBLIC) {
Expand Down Expand Up @@ -98,8 +93,4 @@ function VisibilityPage({report}: VisibilityProps) {

VisibilityPage.displayName = 'VisibilityPage';

export default withOnyx<VisibilityProps, VisibilityOnyxProps>({
report: {
key: ({route}) => `${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID ?? ''}`,
},
})(VisibilityPage);
export default withReportOrNotFound()(VisibilityPage);

0 comments on commit 20a749a

Please sign in to comment.