From b93be75dc4689c727d8fddbfc6b1b0f07d936e0a Mon Sep 17 00:00:00 2001 From: Jasper Huang Date: Mon, 7 Jun 2021 12:11:19 +0800 Subject: [PATCH 1/3] Add paypal name save confirmation --- package-lock.json | 3 ++- src/languages/en.js | 1 + src/pages/settings/PaymentsPage.js | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 654b62486c5f..c17cdc4d101d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23126,7 +23126,8 @@ "ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "inline-style-parser": { "version": "0.1.1", diff --git a/src/languages/en.js b/src/languages/en.js index da87f117e21b..acb1a603eb12 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -199,6 +199,7 @@ export default { payPalMe: 'PayPal.me/', yourPayPalUsername: 'Your PayPal username', addPayPalAccount: 'Add PayPal Account', + growlMessageOnSave: 'Your PayPal username was successfully added', }, preferencesPage: { mostRecent: 'Most Recent', diff --git a/src/pages/settings/PaymentsPage.js b/src/pages/settings/PaymentsPage.js index 9a9df206ce2b..f666e60a795e 100755 --- a/src/pages/settings/PaymentsPage.js +++ b/src/pages/settings/PaymentsPage.js @@ -15,6 +15,7 @@ import styles from '../../styles/styles'; import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; import compose from '../../libs/compose'; import Button from '../../components/Button'; +import Growl from '../../libs/Growl'; const propTypes = { /** Username for PayPal.Me */ @@ -54,6 +55,7 @@ class PaymentsPage extends React.Component { */ setPayPalMeUsername() { NameValuePair.set(CONST.NVP.PAYPAL_ME_ADDRESS, this.state.payPalMeUsername, ONYXKEYS.NVP_PAYPAL_ME_ADDRESS); + Growl.show(this.props.translate('paymentsPage.growlMessageOnSave'), CONST.GROWL.SUCCESS, 3000); } render() { @@ -78,10 +80,12 @@ class PaymentsPage extends React.Component { value={this.state.payPalMeUsername} placeholder={this.props.translate('paymentsPage.yourPayPalUsername')} onChangeText={text => this.setState({payPalMeUsername: text})} + editable={!this.props.payPalMeUsername} />