@@ -10,6 +10,7 @@ import ScrollView from '@components/ScrollView';
10
10
import Text from '@components/Text' ;
11
11
import TextLink from '@components/TextLink' ;
12
12
import useLocalize from '@hooks/useLocalize' ;
13
+ import useNetwork from '@hooks/useNetwork' ;
13
14
import useThemeStyles from '@hooks/useThemeStyles' ;
14
15
import type { CustomSubStepProps } from '@pages/settings/Wallet/InternationalDepositAccount/types' ;
15
16
import * as BankAccounts from '@userActions/BankAccounts' ;
@@ -18,6 +19,14 @@ import ONYXKEYS from '@src/ONYXKEYS';
18
19
19
20
const STEP_INDEXES = CONST . CORPAY_FIELDS . INDEXES . MAPPING ;
20
21
22
+ type MenuItemProps = {
23
+ description : string ;
24
+ title : string ;
25
+ shouldShowRightIcon : boolean ;
26
+ onPress : ( ) => void ;
27
+ interactive ?: boolean ;
28
+ } ;
29
+
21
30
function TermsAndConditionsLabel ( ) {
22
31
const { translate} = useLocalize ( ) ;
23
32
return (
@@ -34,6 +43,7 @@ function Confirmation({onNext, onMove, formValues, fieldsMap}: CustomSubStepProp
34
43
const [ isSubmitting , setIsSubmitting ] = useState ( false ) ;
35
44
const [ error , setError ] = useState ( '' ) ;
36
45
const [ corpayFields ] = useOnyx ( ONYXKEYS . CORPAY_FIELDS ) ;
46
+ const { isOffline} = useNetwork ( ) ;
37
47
38
48
const getDataAndGoToNextStep = ( values : FormOnyxValues < typeof ONYXKEYS . FORMS . INTERNATIONAL_BANK_ACCOUNT_FORM > ) => {
39
49
setError ( '' ) ;
@@ -55,22 +65,24 @@ function Confirmation({onNext, onMove, formValues, fieldsMap}: CustomSubStepProp
55
65
} ) ;
56
66
} ;
57
67
58
- const summaryItems = [
68
+ const summaryItems : MenuItemProps [ ] = [
59
69
{
60
70
description : translate ( 'common.country' ) ,
61
71
title : formValues . bankCountry ,
62
- shouldShowRightIcon : true ,
72
+ shouldShowRightIcon : ! isOffline ,
63
73
onPress : ( ) => {
64
74
onMove ( STEP_INDEXES . COUNTRY_SELECTOR ) ;
65
75
} ,
76
+ interactive : ! isOffline ,
66
77
} ,
67
78
{
68
79
description : translate ( 'common.currency' ) ,
69
80
title : formValues . bankCurrency ,
70
- shouldShowRightIcon : true ,
81
+ shouldShowRightIcon : ! isOffline ,
71
82
onPress : ( ) => {
72
83
onMove ( STEP_INDEXES . BANK_ACCOUNT_DETAILS ) ;
73
84
} ,
85
+ interactive : ! isOffline ,
74
86
} ,
75
87
] ;
76
88
@@ -145,13 +157,14 @@ function Confirmation({onNext, onMove, formValues, fieldsMap}: CustomSubStepProp
145
157
< ScrollView contentContainerStyle = { styles . flexGrow1 } >
146
158
< Text style = { [ styles . textHeadlineLineHeightXXL , styles . ph5 , styles . mb3 ] } > { translate ( 'addPersonalBankAccount.confirmationStepHeader' ) } </ Text >
147
159
< Text style = { [ styles . mb6 , styles . ph5 , styles . textSupporting ] } > { translate ( 'addPersonalBankAccount.confirmationStepSubHeader' ) } </ Text >
148
- { summaryItems . map ( ( { description, title, shouldShowRightIcon, onPress} ) => (
160
+ { summaryItems . map ( ( { description, title, shouldShowRightIcon, interactive , onPress} ) => (
149
161
< MenuItemWithTopDescription
150
162
key = { `${ title } _${ description } ` }
151
163
description = { description }
152
164
title = { title }
153
165
shouldShowRightIcon = { shouldShowRightIcon }
154
166
onPress = { onPress }
167
+ interactive = { interactive }
155
168
/>
156
169
) ) }
157
170
< FormProvider
0 commit comments