Skip to content

Commit f622930

Browse files
MelvinBotsituchan
andcommitted
Revert to FullscreenLoadingIndicator with shouldUseGoBackButton enabled
Keep FullscreenLoadingIndicator instead of raw ActivityIndicator, and enable shouldUseGoBackButton so users get a "Go Back" option after a timeout. Co-authored-by: Situ Chandra Shil <situchan@users.noreply.github.com>
1 parent 7ae4228 commit f622930

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

src/pages/inbox/report/withReportOrNotFound.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import {useIsFocused} from '@react-navigation/native';
22
import type {ComponentType} from 'react';
33
import React, {useEffect} from 'react';
4-
import {StyleSheet, View} from 'react-native';
54
import type {OnyxEntry} from 'react-native-onyx';
6-
import ActivityIndicator from '@components/ActivityIndicator';
5+
import FullscreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
76
import useOnyx from '@hooks/useOnyx';
87
import useReportIsArchived from '@hooks/useReportIsArchived';
9-
import useThemeStyles from '@hooks/useThemeStyles';
108
import {openReport} from '@libs/actions/Report';
119
import getComponentDisplayName from '@libs/getComponentDisplayName';
1210
import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types';
@@ -23,7 +21,6 @@ import type {
2321
RoomMembersNavigatorParamList,
2422
} from '@navigation/types';
2523
import NotFoundPage from '@pages/ErrorPage/NotFoundPage';
26-
import CONST from '@src/CONST';
2724
import ONYXKEYS from '@src/ONYXKEYS';
2825
import type SCREENS from '@src/SCREENS';
2926
import type * as OnyxTypes from '@src/types/onyx';
@@ -74,7 +71,6 @@ type WithReportOrNotFoundProps = WithReportOrNotFoundOnyxProps & {
7471
export default function (shouldRequireReportID = true): <TProps extends WithReportOrNotFoundProps>(WrappedComponent: ComponentType<TProps>) => ComponentType<TProps> {
7572
return function <TProps extends WithReportOrNotFoundProps>(WrappedComponent: ComponentType<TProps>) {
7673
function WithReportOrNotFound(props: TProps) {
77-
const styles = useThemeStyles();
7874
const [betas] = useOnyx(ONYXKEYS.BETAS);
7975
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${props.route.params.reportID}`);
8076
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`);
@@ -119,12 +115,10 @@ export default function (shouldRequireReportID = true): <TProps extends WithRepo
119115
shouldFetchReport,
120116
};
121117
return (
122-
<View style={[StyleSheet.absoluteFill, styles.fullScreenLoading, styles.w100]}>
123-
<ActivityIndicator
124-
size={CONST.ACTIVITY_INDICATOR_SIZE.LARGE}
125-
reasonAttributes={reasonAttributes}
126-
/>
127-
</View>
118+
<FullscreenLoadingIndicator
119+
shouldUseGoBackButton
120+
reasonAttributes={reasonAttributes}
121+
/>
128122
);
129123
}
130124

0 commit comments

Comments
 (0)