Skip to content

Commit df3e1e4

Browse files
authored
Merge pull request #51019 from MrMuzyk/feat/frame-for-non-usd
feat: Frame for non USD bank account flow
2 parents b2fc5c9 + d81272c commit df3e1e4

File tree

15 files changed

+661
-13
lines changed

15 files changed

+661
-13
lines changed

src/CONST.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,19 @@ const CONST = {
471471
PERSONAL: 'PERSONAL',
472472
},
473473
},
474+
NON_USD_BANK_ACCOUNT: {
475+
STEP: {
476+
COUNTRY: 'CountryStep',
477+
BANK_INFO: 'BankInfoStep',
478+
BUSINESS_INFO: 'BusinessInfoStep',
479+
BENEFICIAL_OWNER_INFO: 'BeneficialOwnerInfoStep',
480+
SIGNER_INFO: 'SignerInfoStep',
481+
AGREEMENTS: 'AgreementsStep',
482+
FINISH: 'FinishStep',
483+
},
484+
STEP_NAMES: ['1', '2', '3', '4', '5', '6'],
485+
STEP_HEADER_HEIGHT: 40,
486+
},
474487
INCORPORATION_TYPES: {
475488
LLC: 'LLC',
476489
CORPORATION: 'Corp',

src/languages/en.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,7 @@ const translations = {
21602160
companyAddress: 'Company address',
21612161
listOfRestrictedBusinesses: 'list of restricted businesses',
21622162
confirmCompanyIsNot: 'I confirm that this company is not on the',
2163+
businessInfoTitle: 'Business info',
21632164
},
21642165
beneficialOwnerInfoStep: {
21652166
doYouOwn25percent: 'Do you own 25% or more of',
@@ -2238,6 +2239,21 @@ const translations = {
22382239
enable2FAText: 'We take your security seriously. Please set up 2FA now to add an extra layer of protection to your account.',
22392240
secureYourAccount: 'Secure your account',
22402241
},
2242+
countryStep: {
2243+
confirmBusinessBank: 'Confirm business bank account currency and country',
2244+
confirmCurrency: 'Confirm currency and country',
2245+
},
2246+
signerInfoStep: {
2247+
signerInfo: 'Signer info',
2248+
},
2249+
agreementsStep: {
2250+
agreements: 'Agreements',
2251+
pleaseConfirm: 'Please confirm the agreements below',
2252+
accept: 'Accept and add bank account',
2253+
},
2254+
finishStep: {
2255+
connect: 'Connect bank account',
2256+
},
22412257
reimbursementAccountLoadingAnimation: {
22422258
oneMoment: 'One moment',
22432259
explanationLine: "We’re taking a look at your information. You'll be able to continue with next steps shortly.",

src/languages/es.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,6 +2184,7 @@ const translations = {
21842184
companyAddress: 'Dirección de la empresa',
21852185
listOfRestrictedBusinesses: 'lista de negocios restringidos',
21862186
confirmCompanyIsNot: 'Confirmo que esta empresa no está en la',
2187+
businessInfoTitle: 'Información del negocio',
21872188
},
21882189
beneficialOwnerInfoStep: {
21892190
doYouOwn25percent: '¿Posees el 25% o más de',
@@ -2262,6 +2263,21 @@ const translations = {
22622263
enable2FAText: 'Tu seguridad es importante para nosotros. Por favor, configura ahora la autenticación de dos factores para añadir una capa adicional de protección a tu cuenta.',
22632264
secureYourAccount: 'Asegura tu cuenta',
22642265
},
2266+
countryStep: {
2267+
confirmBusinessBank: 'Confirmar moneda y país de la cuenta bancaria comercial',
2268+
confirmCurrency: 'Confirmar moneda y país',
2269+
},
2270+
signerInfoStep: {
2271+
signerInfo: 'Información del firmante',
2272+
},
2273+
agreementsStep: {
2274+
agreements: 'Acuerdos',
2275+
pleaseConfirm: 'Por favor confirme los acuerdos a continuación',
2276+
accept: 'Aceptar y añadir cuenta bancaria',
2277+
},
2278+
finishStep: {
2279+
connect: 'Conectar cuenta bancaria',
2280+
},
22652281
reimbursementAccountLoadingAnimation: {
22662282
oneMoment: 'Un momento',
22672283
explanationLine: 'Estamos verificando tu información y podrás continuar con los siguientes pasos en unos momentos.',
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import type {ComponentType} from 'react';
2+
import React from 'react';
3+
import InteractiveStepWrapper from '@components/InteractiveStepWrapper';
4+
import useLocalize from '@hooks/useLocalize';
5+
import useSubStep from '@hooks/useSubStep';
6+
import type {SubStepProps} from '@hooks/useSubStep/types';
7+
import CONST from '@src/CONST';
8+
import Confirmation from './substeps/Confirmation';
9+
10+
type AgreementsProps = {
11+
/** Handles back button press */
12+
onBackButtonPress: () => void;
13+
14+
/** Handles submit button press */
15+
onSubmit: () => void;
16+
};
17+
18+
const bodyContent: Array<ComponentType<SubStepProps>> = [Confirmation];
19+
20+
function Agreements({onBackButtonPress, onSubmit}: AgreementsProps) {
21+
const {translate} = useLocalize();
22+
23+
const submit = () => {
24+
onSubmit();
25+
};
26+
27+
const {componentToRender: SubStep, isEditing, screenIndex, nextScreen, prevScreen, moveTo, goToTheLastStep} = useSubStep({bodyContent, startFrom: 0, onFinished: submit});
28+
29+
const handleBackButtonPress = () => {
30+
if (isEditing) {
31+
goToTheLastStep();
32+
return;
33+
}
34+
35+
if (screenIndex === 0) {
36+
onBackButtonPress();
37+
} else {
38+
prevScreen();
39+
}
40+
};
41+
42+
return (
43+
<InteractiveStepWrapper
44+
wrapperID={Agreements.displayName}
45+
handleBackButtonPress={handleBackButtonPress}
46+
headerTitle={translate('agreementsStep.agreements')}
47+
stepNames={CONST.NON_USD_BANK_ACCOUNT.STEP_NAMES}
48+
startStepIndex={5}
49+
>
50+
<SubStep
51+
isEditing={isEditing}
52+
onNext={nextScreen}
53+
onMove={moveTo}
54+
/>
55+
</InteractiveStepWrapper>
56+
);
57+
}
58+
59+
Agreements.displayName = 'Agreements';
60+
61+
export default Agreements;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import React from 'react';
2+
import FormProvider from '@components/Form/FormProvider';
3+
import Text from '@components/Text';
4+
import useLocalize from '@hooks/useLocalize';
5+
import type {SubStepProps} from '@hooks/useSubStep/types';
6+
import useThemeStyles from '@hooks/useThemeStyles';
7+
import ONYXKEYS from '@src/ONYXKEYS';
8+
9+
function Confirmation({onNext}: SubStepProps) {
10+
const {translate} = useLocalize();
11+
const styles = useThemeStyles();
12+
13+
return (
14+
<FormProvider
15+
formID={ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM}
16+
onSubmit={onNext}
17+
submitButtonText={translate('agreementsStep.accept')}
18+
style={[styles.mh5, styles.flexGrow1]}
19+
enabledWhenOffline={false}
20+
>
21+
<Text style={[styles.textHeadlineLineHeightXXL]}>{translate('agreementsStep.pleaseConfirm')}</Text>
22+
</FormProvider>
23+
);
24+
}
25+
26+
Confirmation.displayName = 'Confirmation';
27+
28+
export default Confirmation;
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import type {ComponentType} from 'react';
2+
import React from 'react';
3+
import InteractiveStepWrapper from '@components/InteractiveStepWrapper';
4+
import useLocalize from '@hooks/useLocalize';
5+
import useSubStep from '@hooks/useSubStep';
6+
import type {SubStepProps} from '@hooks/useSubStep/types';
7+
import CONST from '@src/CONST';
8+
import Confirmation from './substeps/Confirmation';
9+
10+
type BankInfoProps = {
11+
/** Handles back button press */
12+
onBackButtonPress: () => void;
13+
14+
/** Handles submit button press */
15+
onSubmit: () => void;
16+
};
17+
18+
const bodyContent: Array<ComponentType<SubStepProps>> = [Confirmation];
19+
20+
function BankInfo({onBackButtonPress, onSubmit}: BankInfoProps) {
21+
const {translate} = useLocalize();
22+
23+
const submit = () => {
24+
onSubmit();
25+
};
26+
27+
const {componentToRender: SubStep, isEditing, screenIndex, nextScreen, prevScreen, moveTo, goToTheLastStep} = useSubStep<SubStepProps>({bodyContent, startFrom: 0, onFinished: submit});
28+
29+
const handleBackButtonPress = () => {
30+
if (isEditing) {
31+
goToTheLastStep();
32+
return;
33+
}
34+
35+
if (screenIndex === 0) {
36+
onBackButtonPress();
37+
} else {
38+
prevScreen();
39+
}
40+
};
41+
42+
return (
43+
<InteractiveStepWrapper
44+
wrapperID={BankInfo.displayName}
45+
handleBackButtonPress={handleBackButtonPress}
46+
headerTitle={translate('bankAccount.bankInfo')}
47+
stepNames={CONST.NON_USD_BANK_ACCOUNT.STEP_NAMES}
48+
startStepIndex={1}
49+
>
50+
<SubStep
51+
isEditing={isEditing}
52+
onNext={nextScreen}
53+
onMove={moveTo}
54+
/>
55+
</InteractiveStepWrapper>
56+
);
57+
}
58+
59+
BankInfo.displayName = 'BankInfo';
60+
61+
export default BankInfo;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import React from 'react';
2+
import {View} from 'react-native';
3+
import Button from '@components/Button';
4+
import SafeAreaConsumer from '@components/SafeAreaConsumer';
5+
import ScrollView from '@components/ScrollView';
6+
import useLocalize from '@hooks/useLocalize';
7+
import type {SubStepProps} from '@hooks/useSubStep/types';
8+
import useThemeStyles from '@hooks/useThemeStyles';
9+
10+
function Confirmation({onNext}: SubStepProps) {
11+
const {translate} = useLocalize();
12+
const styles = useThemeStyles();
13+
14+
return (
15+
<SafeAreaConsumer>
16+
{({safeAreaPaddingBottomStyle}) => (
17+
<ScrollView
18+
style={styles.pt0}
19+
contentContainerStyle={[styles.flexGrow1, safeAreaPaddingBottomStyle]}
20+
>
21+
<View style={[styles.p5, styles.flexGrow1, styles.justifyContentEnd]}>
22+
<Button
23+
success
24+
style={[styles.w100]}
25+
onPress={onNext}
26+
large
27+
text={translate('common.confirm')}
28+
/>
29+
</View>
30+
</ScrollView>
31+
)}
32+
</SafeAreaConsumer>
33+
);
34+
}
35+
36+
Confirmation.displayName = 'Confirmation';
37+
38+
export default Confirmation;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import React from 'react';
2+
import {View} from 'react-native';
3+
import Button from '@components/Button';
4+
import InteractiveStepWrapper from '@components/InteractiveStepWrapper';
5+
import useLocalize from '@hooks/useLocalize';
6+
import useThemeStyles from '@hooks/useThemeStyles';
7+
import CONST from '@src/CONST';
8+
9+
type BeneficialOwnerInfoProps = {
10+
/** Handles back button press */
11+
onBackButtonPress: () => void;
12+
13+
/** Handles submit button press */
14+
onSubmit: () => void;
15+
};
16+
17+
function BeneficialOwnerInfo({onBackButtonPress, onSubmit}: BeneficialOwnerInfoProps) {
18+
const {translate} = useLocalize();
19+
const styles = useThemeStyles();
20+
21+
return (
22+
<InteractiveStepWrapper
23+
wrapperID={BeneficialOwnerInfo.displayName}
24+
handleBackButtonPress={onBackButtonPress}
25+
headerTitle={translate('beneficialOwnerInfoStep.companyOwner')}
26+
stepNames={CONST.NON_USD_BANK_ACCOUNT.STEP_NAMES}
27+
startStepIndex={3}
28+
>
29+
<View style={styles.mtAuto}>
30+
<Button
31+
success
32+
large
33+
style={[styles.w100, styles.mt2, styles.pb5, styles.ph5]}
34+
onPress={onSubmit}
35+
text={translate('common.confirm')}
36+
/>
37+
</View>
38+
</InteractiveStepWrapper>
39+
);
40+
}
41+
42+
BeneficialOwnerInfo.displayName = 'BeneficialOwnerInfo';
43+
44+
export default BeneficialOwnerInfo;
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import type {ComponentType} from 'react';
2+
import React from 'react';
3+
import InteractiveStepWrapper from '@components/InteractiveStepWrapper';
4+
import useLocalize from '@hooks/useLocalize';
5+
import useSubStep from '@hooks/useSubStep';
6+
import type {SubStepProps} from '@hooks/useSubStep/types';
7+
import CONST from '@src/CONST';
8+
import Confirmation from './substeps/Confirmation';
9+
10+
type BusinessInfoProps = {
11+
/** Handles back button press */
12+
onBackButtonPress: () => void;
13+
14+
/** Handles submit button press */
15+
onSubmit: () => void;
16+
};
17+
18+
const bodyContent: Array<ComponentType<SubStepProps>> = [Confirmation];
19+
20+
function BusinessInfo({onBackButtonPress, onSubmit}: BusinessInfoProps) {
21+
const {translate} = useLocalize();
22+
23+
const submit = () => {
24+
onSubmit();
25+
};
26+
27+
const {componentToRender: SubStep, isEditing, screenIndex, nextScreen, prevScreen, moveTo, goToTheLastStep} = useSubStep({bodyContent, startFrom: 0, onFinished: submit});
28+
29+
const handleBackButtonPress = () => {
30+
if (isEditing) {
31+
goToTheLastStep();
32+
return;
33+
}
34+
35+
if (screenIndex === 0) {
36+
onBackButtonPress();
37+
} else {
38+
prevScreen();
39+
}
40+
};
41+
42+
return (
43+
<InteractiveStepWrapper
44+
wrapperID={BusinessInfo.displayName}
45+
handleBackButtonPress={handleBackButtonPress}
46+
headerTitle={translate('businessInfoStep.businessInfoTitle')}
47+
stepNames={CONST.NON_USD_BANK_ACCOUNT.STEP_NAMES}
48+
startStepIndex={2}
49+
>
50+
<SubStep
51+
isEditing={isEditing}
52+
onNext={nextScreen}
53+
onMove={moveTo}
54+
/>
55+
</InteractiveStepWrapper>
56+
);
57+
}
58+
59+
BusinessInfo.displayName = 'BusinessInfo';
60+
61+
export default BusinessInfo;

0 commit comments

Comments
 (0)