@@ -2,7 +2,6 @@ import {Str} from 'expensify-common';
22import React , { useEffect , useState } from 'react' ;
33import { View } from 'react-native' ;
44import ConfirmModal from '@components/ConfirmModal' ;
5- import DelegateNoAccessWrapper from '@components/DelegateNoAccessWrapper' ;
65import FormProvider from '@components/Form/FormProvider' ;
76import InputWrapper from '@components/Form/InputWrapper' ;
87import type { FormInputErrors , FormOnyxValues } from '@components/Form/types' ;
@@ -90,65 +89,63 @@ function CloseAccountPage() {
9089 includeSafeAreaPaddingBottom
9190 testID = "CloseAccountPage"
9291 >
93- < DelegateNoAccessWrapper accessDeniedVariants = { [ CONST . DELEGATE . DENIED_ACCESS_VARIANTS . SUBMITTER ] } >
94- < HeaderWithBackButton
95- title = { translate ( 'closeAccountPage.closeAccount' ) }
96- onBackButtonPress = { ( ) => Navigation . goBack ( ) }
97- />
98- < FormProvider
99- formID = { ONYXKEYS . FORMS . CLOSE_ACCOUNT_FORM }
100- validate = { validate }
101- onSubmit = { showConfirmModal }
102- submitButtonText = { translate ( 'closeAccountPage.closeAccount' ) }
103- style = { [ styles . flexGrow1 , styles . mh5 ] }
104- isSubmitActionDangerous
92+ < HeaderWithBackButton
93+ title = { translate ( 'closeAccountPage.closeAccount' ) }
94+ onBackButtonPress = { ( ) => Navigation . goBack ( ) }
95+ />
96+ < FormProvider
97+ formID = { ONYXKEYS . FORMS . CLOSE_ACCOUNT_FORM }
98+ validate = { validate }
99+ onSubmit = { showConfirmModal }
100+ submitButtonText = { translate ( 'closeAccountPage.closeAccount' ) }
101+ style = { [ styles . flexGrow1 , styles . mh5 ] }
102+ isSubmitActionDangerous
103+ >
104+ < View
105+ fsClass = { CONST . FULLSTORY . CLASS . UNMASK }
106+ style = { [ styles . flexGrow1 ] }
105107 >
106- < View
107- fsClass = { CONST . FULLSTORY . CLASS . UNMASK }
108- style = { [ styles . flexGrow1 ] }
109- >
110- < Text > { translate ( 'closeAccountPage.reasonForLeavingPrompt' ) } </ Text >
111- < InputWrapper
112- InputComponent = { TextInput }
113- inputID = { INPUT_IDS . REASON_FOR_LEAVING }
114- autoGrowHeight
115- maxAutoGrowHeight = { variables . textInputAutoGrowMaxHeight }
116- label = { translate ( 'closeAccountPage.enterMessageHere' ) }
117- aria-label = { translate ( 'closeAccountPage.enterMessageHere' ) }
118- role = { CONST . ROLE . PRESENTATION }
119- containerStyles = { [ styles . mt5 ] }
120- forwardedFSClass = { CONST . FULLSTORY . CLASS . UNMASK }
121- />
122- < Text style = { [ styles . mt5 ] } >
123- { translate ( 'closeAccountPage.enterDefaultContactToConfirm' ) } < Text style = { [ styles . textStrong ] } > { userEmailOrPhone } </ Text >
124- </ Text >
125- < InputWrapper
126- InputComponent = { TextInput }
127- inputID = { INPUT_IDS . PHONE_OR_EMAIL }
128- autoCapitalize = "none"
129- label = { translate ( 'closeAccountPage.enterDefaultContact' ) }
130- aria-label = { translate ( 'closeAccountPage.enterDefaultContact' ) }
131- role = { CONST . ROLE . PRESENTATION }
132- containerStyles = { [ styles . mt5 ] }
133- autoCorrect = { false }
134- inputMode = { userEmailOrPhone && Str . isValidEmail ( userEmailOrPhone ) ? CONST . INPUT_MODE . EMAIL : CONST . INPUT_MODE . TEXT }
135- forwardedFSClass = { CONST . FULLSTORY . CLASS . UNMASK }
136- />
137- < ConfirmModal
138- danger
139- title = { translate ( 'closeAccountPage.closeAccountWarning' ) }
140- onConfirm = { onConfirm }
141- onCancel = { hideConfirmModal }
142- isVisible = { isConfirmModalVisible }
143- prompt = { translate ( 'closeAccountPage.closeAccountPermanentlyDeleteData' ) }
144- confirmText = { translate ( 'common.yesContinue' ) }
145- cancelText = { translate ( 'common.cancel' ) }
146- shouldDisableConfirmButtonWhenOffline
147- shouldShowCancelButton
148- />
149- </ View >
150- </ FormProvider >
151- </ DelegateNoAccessWrapper >
108+ < Text > { translate ( 'closeAccountPage.reasonForLeavingPrompt' ) } </ Text >
109+ < InputWrapper
110+ InputComponent = { TextInput }
111+ inputID = { INPUT_IDS . REASON_FOR_LEAVING }
112+ autoGrowHeight
113+ maxAutoGrowHeight = { variables . textInputAutoGrowMaxHeight }
114+ label = { translate ( 'closeAccountPage.enterMessageHere' ) }
115+ aria-label = { translate ( 'closeAccountPage.enterMessageHere' ) }
116+ role = { CONST . ROLE . PRESENTATION }
117+ containerStyles = { [ styles . mt5 ] }
118+ forwardedFSClass = { CONST . FULLSTORY . CLASS . UNMASK }
119+ />
120+ < Text style = { [ styles . mt5 ] } >
121+ { translate ( 'closeAccountPage.enterDefaultContactToConfirm' ) } < Text style = { [ styles . textStrong ] } > { userEmailOrPhone } </ Text >
122+ </ Text >
123+ < InputWrapper
124+ InputComponent = { TextInput }
125+ inputID = { INPUT_IDS . PHONE_OR_EMAIL }
126+ autoCapitalize = "none"
127+ label = { translate ( 'closeAccountPage.enterDefaultContact' ) }
128+ aria-label = { translate ( 'closeAccountPage.enterDefaultContact' ) }
129+ role = { CONST . ROLE . PRESENTATION }
130+ containerStyles = { [ styles . mt5 ] }
131+ autoCorrect = { false }
132+ inputMode = { userEmailOrPhone && Str . isValidEmail ( userEmailOrPhone ) ? CONST . INPUT_MODE . EMAIL : CONST . INPUT_MODE . TEXT }
133+ forwardedFSClass = { CONST . FULLSTORY . CLASS . UNMASK }
134+ />
135+ < ConfirmModal
136+ danger
137+ title = { translate ( 'closeAccountPage.closeAccountWarning' ) }
138+ onConfirm = { onConfirm }
139+ onCancel = { hideConfirmModal }
140+ isVisible = { isConfirmModalVisible }
141+ prompt = { translate ( 'closeAccountPage.closeAccountPermanentlyDeleteData' ) }
142+ confirmText = { translate ( 'common.yesContinue' ) }
143+ cancelText = { translate ( 'common.cancel' ) }
144+ shouldDisableConfirmButtonWhenOffline
145+ shouldShowCancelButton
146+ />
147+ </ View >
148+ </ FormProvider >
152149 </ ScreenWrapper >
153150 ) ;
154151}
0 commit comments