Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/pages/inbox/report/withReportOrNotFound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
import {useIsFocused} from '@react-navigation/native';
import type {ComponentType} from 'react';
import React, {useEffect} from 'react';
import {StyleSheet, View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import FullscreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
import ActivityIndicator from '@components/ActivityIndicator';
import useOnyx from '@hooks/useOnyx';
import useReportIsArchived from '@hooks/useReportIsArchived';
import useThemeStyles from '@hooks/useThemeStyles';
import {openReport} from '@libs/actions/Report';
import getComponentDisplayName from '@libs/getComponentDisplayName';
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
Expand All @@ -22,6 +24,7 @@ import type {
RoomMembersNavigatorParamList,
} from '@navigation/types';
import NotFoundPage from '@pages/ErrorPage/NotFoundPage';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type SCREENS from '@src/SCREENS';
import type * as OnyxTypes from '@src/types/onyx';
Expand Down Expand Up @@ -69,6 +72,7 @@ type WithReportOrNotFoundProps = WithReportOrNotFoundOnyxProps & {
export default function (shouldRequireReportID = true): <TProps extends WithReportOrNotFoundProps>(WrappedComponent: ComponentType<TProps>) => ComponentType<TProps> {
return function <TProps extends WithReportOrNotFoundProps>(WrappedComponent: ComponentType<TProps>) {
function WithReportOrNotFound(props: TProps) {
const styles = useThemeStyles();
const [betas] = useOnyx(ONYXKEYS.BETAS);
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${props.route.params.reportID}`);
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`);
Expand Down Expand Up @@ -111,7 +115,14 @@ export default function (shouldRequireReportID = true): <TProps extends WithRepo
isLoadingReportData: isLoadingReportData !== false,
shouldFetchReport,
};
return <FullscreenLoadingIndicator reasonAttributes={reasonAttributes} />;
return (
<View style={[StyleSheet.absoluteFill, styles.fullScreenLoading, styles.w100]}>
<ActivityIndicator
size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
reasonAttributes={reasonAttributes}
/>
</View>
);
}

if (shouldShowNotFoundPage) {
Expand Down
Loading