-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5311 from Expensify/marcaaron-removeConfirmModals
Remove confirm modals from the VBA flow
- Loading branch information
Showing
15 changed files
with
491 additions
and
556 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,10 +20,10 @@ import styles from '../styles/styles'; | |
import themeColors from '../styles/themes/default'; | ||
import compose from '../libs/compose'; | ||
import withLocalize, {withLocalizePropTypes} from './withLocalize'; | ||
import Button from './Button'; | ||
import ExpensiPicker from './ExpensiPicker'; | ||
import Text from './Text'; | ||
import * as ReimbursementAccountUtils from '../libs/ReimbursementAccountUtils'; | ||
import ReimbursementAccountForm from '../pages/ReimbursementAccount/ReimbursementAccountForm'; | ||
|
||
const propTypes = { | ||
...withLocalizePropTypes, | ||
|
@@ -95,7 +95,6 @@ class AddPlaidBankAccount extends React.Component { | |
|
||
this.state = { | ||
selectedIndex: undefined, | ||
isCreatingAccount: false, | ||
institution: {}, | ||
}; | ||
|
||
|
@@ -139,7 +138,6 @@ class AddPlaidBankAccount extends React.Component { | |
this.props.onSubmit({ | ||
account, plaidLinkToken: this.props.plaidLinkToken, | ||
}); | ||
this.setState({isCreatingAccount: true}); | ||
} | ||
|
||
render() { | ||
|
@@ -173,40 +171,32 @@ class AddPlaidBankAccount extends React.Component { | |
/> | ||
)} | ||
{accounts.length > 0 && ( | ||
<> | ||
<View style={[styles.m5, styles.flex1]}> | ||
{!_.isEmpty(this.props.text) && ( | ||
<Text style={[styles.mb5]}>{this.props.text}</Text> | ||
)} | ||
{/* @TODO there are a bunch of logos to incorporate here to replace this name | ||
https://d2k5nsl2zxldvw.cloudfront.net/images/plaid/[email protected] */} | ||
<Text style={[styles.mb5, styles.h1]}>{this.state.institution.name}</Text> | ||
<View style={[styles.mb5]}> | ||
<ExpensiPicker | ||
label={this.props.translate('addPersonalBankAccountPage.chooseAccountLabel')} | ||
onChange={(index) => { | ||
this.setState({selectedIndex: Number(index)}); | ||
this.clearError('selectedBank'); | ||
}} | ||
items={options} | ||
placeholder={_.isUndefined(this.state.selectedIndex) ? { | ||
value: '', | ||
label: this.props.translate('bankAccount.chooseAnAccount'), | ||
} : {}} | ||
value={this.state.selectedIndex} | ||
hasError={this.getErrors().selectedBank} | ||
/> | ||
</View> | ||
</View> | ||
<View style={[styles.m5]}> | ||
<Button | ||
success | ||
text={this.props.translate('common.saveAndContinue')} | ||
isLoading={this.state.isCreatingAccount} | ||
onPress={this.selectAccount} | ||
<ReimbursementAccountForm | ||
onSubmit={this.selectAccount} | ||
> | ||
{!_.isEmpty(this.props.text) && ( | ||
<Text style={[styles.mb5]}>{this.props.text}</Text> | ||
)} | ||
{/* @TODO there are a bunch of logos to incorporate here to replace this name | ||
https://d2k5nsl2zxldvw.cloudfront.net/images/plaid/[email protected] */} | ||
<Text style={[styles.mb5, styles.h1]}>{this.state.institution.name}</Text> | ||
<View style={[styles.mb5]}> | ||
<ExpensiPicker | ||
label={this.props.translate('addPersonalBankAccountPage.chooseAccountLabel')} | ||
onChange={(index) => { | ||
this.setState({selectedIndex: Number(index)}); | ||
this.clearError('selectedBank'); | ||
}} | ||
items={options} | ||
placeholder={_.isUndefined(this.state.selectedIndex) ? { | ||
value: '', | ||
label: this.props.translate('bankAccount.chooseAnAccount'), | ||
} : {}} | ||
value={this.state.selectedIndex} | ||
hasError={this.getErrors().selectedBank} | ||
/> | ||
</View> | ||
</> | ||
</ReimbursementAccountForm> | ||
)} | ||
</> | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.