Skip to content

Commit

Permalink
Merge pull request #10206 from Expensify/yuwen-makeStagingGreatAgain
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham authored Aug 2, 2022
2 parents 7b169de + 7e6b621 commit 6fdd0dd
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 56 deletions.
37 changes: 26 additions & 11 deletions src/pages/AddPersonalBankAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import AddPlaidBankAccount from '../components/AddPlaidBankAccount';
import getPlaidOAuthReceivedRedirectURI from '../libs/getPlaidOAuthReceivedRedirectURI';
import compose from '../libs/compose';
import ONYXKEYS from '../ONYXKEYS';
import KeyboardAvoidingView from '../components/KeyboardAvoidingView';
import Text from '../components/Text';
import styles from '../styles/styles';
import * as Illustrations from '../components/Icon/Illustrations';
Expand Down Expand Up @@ -176,17 +175,33 @@ class AddPersonalBankAccountPage extends React.Component {
receivedRedirectURI={getPlaidOAuthReceivedRedirectURI()}
/>
{!_.isUndefined(this.state.selectedPlaidBankAccount) && (
<FormAlertWithSubmitButton
isAlertVisible={Boolean(error)}
buttonText={this.props.translate('common.saveAndContinue')}
onSubmit={this.submit}
message={error}
isLoading={loading}
/>
<View style={[styles.mb5]}>
<TextInput
label={this.props.translate('addPersonalBankAccountPage.enterPassword')}
secureTextEntry
value={this.state.password}
autoCompleteType="password"
textContentType="password"
autoCapitalize="none"
autoFocus={canFocusInputOnScreenFocus()}
onChangeText={text => this.setState({password: text})}
errorText={this.getErrorText('password')}
hasError={this.getErrors().password}
/>
</View>
)}
</FormScrollView>
)}
</KeyboardAvoidingView>
</View>
{!_.isUndefined(this.state.selectedPlaidBankAccount) && (
<FormAlertWithSubmitButton
isAlertVisible={Boolean(error)}
buttonText={this.props.translate('common.saveAndContinue')}
onSubmit={this.submit}
message={error}
isLoading={loading}
/>
)}
</FormScrollView>
)}
</ScreenWrapper>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import KYCWall from '../../../../components/KYCWall';
import {propTypes, defaultProps} from './paymentsPagePropTypes';
import {withNetwork} from '../../../../components/OnyxProvider';
import * as PaymentUtils from '../../../../libs/PaymentUtils';
import OfflineIndicator from '../../../../components/OfflineIndicator';

class BasePaymentsPage extends React.Component {
constructor(props) {
Expand Down
107 changes: 62 additions & 45 deletions src/pages/settings/Payments/TransferBalancePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import styles from '../../../styles/styles';
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
import {withNetwork} from '../../../components/OnyxProvider';
import compose from '../../../libs/compose';
import KeyboardAvoidingView from '../../../components/KeyboardAvoidingView';
import * as Expensicons from '../../../components/Icon/Expensicons';
import * as Illustrations from '../../../components/Icon/Illustrations';
import Icon from '../../../components/Icon';
Expand Down Expand Up @@ -208,54 +207,72 @@ class TransferBalancePage extends React.Component {

return (
<ScreenWrapper>
<KeyboardAvoidingView>
<HeaderWithCloseButton
title={this.props.translate('common.transferBalance')}
shouldShowBackButton
onBackButtonPress={() => Navigation.goBack()}
onCloseButtonPress={() => Navigation.dismissModal(true)}
/>
<View style={[styles.flex1, styles.flexBasisAuto, styles.justifyContentCenter]}>
<CurrentWalletBalance balanceStyles={[styles.transferBalanceBalance]} />
<HeaderWithCloseButton
title={this.props.translate('common.transferBalance')}
shouldShowBackButton
onBackButtonPress={() => Navigation.goBack()}
onCloseButtonPress={() => Navigation.dismissModal(true)}
/>
<View style={[styles.flex1, styles.flexBasisAuto, styles.justifyContentCenter]}>
<CurrentWalletBalance balanceStyles={[styles.transferBalanceBalance]} />
</View>
<ScrollView style={styles.flexGrow0} contentContainerStyle={styles.pv5}>
<View style={styles.ph5}>
{_.map(this.paymentTypes, paymentType => (
<MenuItem
key={paymentType.key}
title={paymentType.title}
description={paymentType.description}
iconWidth={variables.iconSizeXLarge}
iconHeight={variables.iconSizeXLarge}
icon={paymentType.icon}
success={selectedPaymentType === paymentType.key}
wrapperStyle={{
...styles.mt3,
...styles.pv4,
...styles.transferBalancePayment,
...(selectedPaymentType === paymentType.key
&& styles.transferBalanceSelectedPayment),
}}
onPress={() => this.navigateToChooseTransferAccount(paymentType.type)}
/>
))}
</View>
<ScrollView style={styles.flexGrow0} contentContainerStyle={styles.pv5}>
<View style={styles.ph5}>
{_.map(this.paymentTypes, paymentType => (
<MenuItem
key={paymentType.key}
title={paymentType.title}
description={paymentType.description}
iconWidth={variables.iconSizeXLarge}
iconHeight={variables.iconSizeXLarge}
icon={paymentType.icon}
success={selectedPaymentType === paymentType.key}
wrapperStyle={{
...styles.mt3,
...styles.pv4,
...styles.transferBalancePayment,
...(selectedPaymentType === paymentType.key
&& styles.transferBalanceSelectedPayment),
}}
onPress={() => this.navigateToChooseTransferAccount(paymentType.type)}
/>
))}
</View>
<Text
style={[styles.p5, styles.textStrong, styles.textLabel, styles.justifyContentStart]}
>
{this.props.translate('transferAmountPage.whichAccount')}
</Text>
{Boolean(selectedAccount)
&& (
<MenuItem
title={selectedAccount.title}
description={selectedAccount.description}
shouldShowRightIcon
iconWidth={selectedAccount.iconSize}
iconHeight={selectedAccount.iconSize}
icon={selectedAccount.icon}
onPress={() => this.navigateToChooseTransferAccount(selectedAccount.accountType)}
/>
)}
<View style={styles.ph5}>
<Text
style={[styles.p5, styles.textStrong, styles.textLabel, styles.justifyContentStart]}
style={[
styles.mt5,
styles.mb3,
styles.textStrong,
styles.textLabel,
styles.justifyContentStart,
]}
>
{this.props.translate('transferAmountPage.whichAccount')}
{this.props.translate('transferAmountPage.fee')}
</Text>
{Boolean(selectedAccount)
&& (
<MenuItem
title={selectedAccount.title}
description={selectedAccount.description}
shouldShowRightIcon
iconWidth={selectedAccount.iconSize}
iconHeight={selectedAccount.iconSize}
icon={selectedAccount.icon}
onPress={() => this.navigateToChooseTransferAccount(selectedAccount.accountType)}
/>
<Text
style={[styles.justifyContentStart]}
>
{this.props.numberFormat(
calculatedFee / 100,
{style: 'currency', currency: 'USD'},
)}
</Text>
</View>
Expand Down

0 comments on commit 6fdd0dd

Please sign in to comment.