Skip to content

Commit

Permalink
Merge pull request #32205 from software-mansion-labs/form-migration/v…
Browse files Browse the repository at this point in the history
…alidation-step

[Form Provider Refactor] ValidationStep
  • Loading branch information
luacmartins authored Dec 7, 2023
2 parents fc4a46f + f96b552 commit 4fba602
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/pages/ReimbursementAccount/ValidationStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {ScrollView, View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import Button from '@components/Button';
import Form from '@components/Form';
import FormProvider from '@components/Form/FormProvider';
import InputWrapper from '@components/Form/InputWrapper';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import * as Expensicons from '@components/Icon/Expensicons';
import * as Illustrations from '@components/Icon/Illustrations';
Expand Down Expand Up @@ -144,7 +145,7 @@ function ValidationStep({reimbursementAccount, translate, onBackButtonPress, acc
</View>
)}
{!maxAttemptsReached && state === BankAccount.STATE.PENDING && (
<Form
<FormProvider
formID={ONYXKEYS.REIMBURSEMENT_ACCOUNT}
submitButtonText={translate('validationStep.buttonText')}
onSubmit={submit}
Expand All @@ -156,23 +157,26 @@ function ValidationStep({reimbursementAccount, translate, onBackButtonPress, acc
<Text style={[styles.mb2]}>{translate('validationStep.descriptionCTA')}</Text>
</View>
<View style={[styles.mv5]}>
<TextInput
<InputWrapper
InputComponent={TextInput}
inputID="amount1"
shouldSaveDraft
containerStyles={[styles.mb1]}
placeholder="1.52"
inputMode={CONST.INPUT_MODE.DECIMAL}
role={CONST.ACCESSIBILITY_ROLE.TEXT}
/>
<TextInput
<InputWrapper
InputComponent={TextInput}
inputID="amount2"
shouldSaveDraft
containerStyles={[styles.mb1]}
placeholder="1.53"
inputMode={CONST.INPUT_MODE.DECIMAL}
role={CONST.ACCESSIBILITY_ROLE.TEXT}
/>
<TextInput
<InputWrapper
InputComponent={TextInput}
shouldSaveDraft
inputID="amount3"
containerStyles={[styles.mb1]}
Expand All @@ -186,7 +190,7 @@ function ValidationStep({reimbursementAccount, translate, onBackButtonPress, acc
<Enable2FAPrompt policyID={policyID} />
</View>
)}
</Form>
</FormProvider>
)}
{isVerifying && (
<ScrollView style={[styles.flex1]}>
Expand Down

0 comments on commit 4fba602

Please sign in to comment.