11import { useIsFocused } from '@react-navigation/native' ;
22import type { ComponentType } from 'react' ;
33import React , { useEffect } from 'react' ;
4- import { StyleSheet , View } from 'react-native' ;
54import type { OnyxEntry } from 'react-native-onyx' ;
6- import ActivityIndicator from '@components/ActivityIndicator ' ;
5+ import FullscreenLoadingIndicator from '@components/FullscreenLoadingIndicator ' ;
76import useOnyx from '@hooks/useOnyx' ;
87import useReportIsArchived from '@hooks/useReportIsArchived' ;
9- import useThemeStyles from '@hooks/useThemeStyles' ;
108import { openReport } from '@libs/actions/Report' ;
119import getComponentDisplayName from '@libs/getComponentDisplayName' ;
1210import type { PlatformStackScreenProps } from '@libs/Navigation/PlatformStackNavigation/types' ;
@@ -23,7 +21,6 @@ import type {
2321 RoomMembersNavigatorParamList ,
2422} from '@navigation/types' ;
2523import NotFoundPage from '@pages/ErrorPage/NotFoundPage' ;
26- import CONST from '@src/CONST' ;
2724import ONYXKEYS from '@src/ONYXKEYS' ;
2825import type SCREENS from '@src/SCREENS' ;
2926import type * as OnyxTypes from '@src/types/onyx' ;
@@ -74,7 +71,6 @@ type WithReportOrNotFoundProps = WithReportOrNotFoundOnyxProps & {
7471export 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