1
1
import { useIsFocused } from '@react-navigation/native' ;
2
- import type { StackScreenProps } from '@react-navigation/stack' ;
3
2
import React , { useCallback , useRef } from 'react' ;
4
3
import { View } from 'react-native' ;
5
4
import { withOnyx } from 'react-native-onyx' ;
@@ -18,14 +17,10 @@ import * as ErrorUtils from '@libs/ErrorUtils';
18
17
import Navigation from '@libs/Navigation/Navigation' ;
19
18
import * as ReportUtils from '@libs/ReportUtils' ;
20
19
import * as ValidationUtils from '@libs/ValidationUtils' ;
21
- import type { ReportSettingsNavigatorParamList } from '@navigation/types' ;
22
- import withReportOrNotFound from '@pages/home/report/withReportOrNotFound' ;
23
- import type { WithReportOrNotFoundProps } from '@pages/home/report/withReportOrNotFound' ;
24
20
import * as ReportActions from '@userActions/Report' ;
25
21
import CONST from '@src/CONST' ;
26
22
import ONYXKEYS from '@src/ONYXKEYS' ;
27
23
import ROUTES from '@src/ROUTES' ;
28
- import type SCREENS from '@src/SCREENS' ;
29
24
import INPUT_IDS from '@src/types/form/RoomNameForm' ;
30
25
import type { Policy , Report } from '@src/types/onyx' ;
31
26
@@ -37,7 +32,9 @@ type RoomNamePageOnyxProps = {
37
32
policy : OnyxEntry < Policy > ;
38
33
} ;
39
34
40
- type RoomNamePageProps = RoomNamePageOnyxProps & WithReportOrNotFoundProps & StackScreenProps < ReportSettingsNavigatorParamList , typeof SCREENS . REPORT_SETTINGS . ROOM_NAME > ;
35
+ type RoomNamePageProps = RoomNamePageOnyxProps & {
36
+ report : Report ;
37
+ } ;
41
38
42
39
function RoomNamePage ( { report, policy, reports} : RoomNamePageProps ) {
43
40
const styles = useThemeStyles ( ) ;
@@ -111,13 +108,11 @@ function RoomNamePage({report, policy, reports}: RoomNamePageProps) {
111
108
112
109
RoomNamePage . displayName = 'RoomNamePage' ;
113
110
114
- export default withReportOrNotFound ( ) (
115
- withOnyx < RoomNamePageProps , RoomNamePageOnyxProps > ( {
116
- reports : {
117
- key : ONYXKEYS . COLLECTION . REPORT ,
118
- } ,
119
- policy : {
120
- key : ( { report} ) => `${ ONYXKEYS . COLLECTION . POLICY } ${ report ?. policyID } ` ,
121
- } ,
122
- } ) ( RoomNamePage ) ,
123
- ) ;
111
+ export default withOnyx < RoomNamePageProps , RoomNamePageOnyxProps > ( {
112
+ reports : {
113
+ key : ONYXKEYS . COLLECTION . REPORT ,
114
+ } ,
115
+ policy : {
116
+ key : ( { report} ) => `${ ONYXKEYS . COLLECTION . POLICY } ${ report ?. policyID } ` ,
117
+ } ,
118
+ } ) ( RoomNamePage ) ;
0 commit comments