1
- import type { StackScreenProps } from '@react-navigation/stack' ;
2
1
import { Str } from 'expensify-common' ;
3
2
import React , { useEffect , useState } from 'react' ;
4
3
import { View } from 'react-native' ;
5
- import { withOnyx } from 'react-native-onyx' ;
6
- import type { OnyxEntry } from 'react-native-onyx' ;
4
+ import { useOnyx } from 'react-native-onyx' ;
7
5
import ConfirmModal from '@components/ConfirmModal' ;
8
6
import FormProvider from '@components/Form/FormProvider' ;
9
7
import InputWrapper from '@components/Form/InputWrapper' ;
@@ -16,24 +14,16 @@ import useLocalize from '@hooks/useLocalize';
16
14
import useThemeStyles from '@hooks/useThemeStyles' ;
17
15
import Navigation from '@libs/Navigation/Navigation' ;
18
16
import * as ValidationUtils from '@libs/ValidationUtils' ;
19
- import type { SettingsNavigatorParamList } from '@navigation/types' ;
20
17
import variables from '@styles/variables' ;
21
18
import * as CloseAccount from '@userActions/CloseAccount' ;
22
19
import * as User from '@userActions/User' ;
23
20
import CONST from '@src/CONST' ;
24
21
import ONYXKEYS from '@src/ONYXKEYS' ;
25
- import type SCREENS from '@src/SCREENS' ;
26
22
import INPUT_IDS from '@src/types/form/CloseAccountForm' ;
27
- import type { Session } from '@src/types/onyx' ;
28
23
29
- type CloseAccountPageOnyxProps = {
30
- /** Session of currently logged in user */
31
- session : OnyxEntry < Session > ;
32
- } ;
24
+ function CloseAccountPage ( ) {
25
+ const [ session ] = useOnyx ( ONYXKEYS . SESSION ) ;
33
26
34
- type CloseAccountPageProps = CloseAccountPageOnyxProps & StackScreenProps < SettingsNavigatorParamList , typeof SCREENS . SETTINGS . CLOSE > ;
35
-
36
- function CloseAccountPage ( { session} : CloseAccountPageProps ) {
37
27
const styles = useThemeStyles ( ) ;
38
28
const { translate, formatPhoneNumber} = useLocalize ( ) ;
39
29
@@ -142,8 +132,4 @@ function CloseAccountPage({session}: CloseAccountPageProps) {
142
132
143
133
CloseAccountPage . displayName = 'CloseAccountPage' ;
144
134
145
- export default withOnyx < CloseAccountPageProps , CloseAccountPageOnyxProps > ( {
146
- session : {
147
- key : ONYXKEYS . SESSION ,
148
- } ,
149
- } ) ( CloseAccountPage ) ;
135
+ export default CloseAccountPage ;
0 commit comments