From de11d57b31b9e45518885068e33ce44d006e40fa Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Thu, 14 May 2020 18:23:12 -0400 Subject: [PATCH 1/5] fix --- app/components/UI/Navbar/index.js | 2 +- .../Views/PaymentChannel/PaymentChannelDeposit/index.js | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/components/UI/Navbar/index.js b/app/components/UI/Navbar/index.js index 62c58b541c3..a42f1a3942e 100644 --- a/app/components/UI/Navbar/index.js +++ b/app/components/UI/Navbar/index.js @@ -325,7 +325,7 @@ export function getPaymentRequestSuccessOptionsTitle(navigation) { export function getTransactionOptionsTitle(_title, navigation) { const transactionMode = navigation.getParam('mode', ''); const { routeName } = navigation.state; - const leftText = transactionMode === 'edit' ? strings('transaction.cancel') : strings('transaction.edit'); + const leftText = transactionMode === 'edit' ? strings('transaction.edit') : strings('transaction.cancel'); const disableModeChange = navigation.getParam('disableModeChange'); const modeChange = navigation.getParam('dispatch', () => { ''; diff --git a/app/components/Views/PaymentChannel/PaymentChannelDeposit/index.js b/app/components/Views/PaymentChannel/PaymentChannelDeposit/index.js index 39c45ff484a..4e6e56a9f3e 100644 --- a/app/components/Views/PaymentChannel/PaymentChannelDeposit/index.js +++ b/app/components/Views/PaymentChannel/PaymentChannelDeposit/index.js @@ -240,9 +240,6 @@ class Deposit extends PureComponent { amountInput = React.createRef(); componentDidMount = () => { - const { navigation } = this.props; - navigation && navigation.setParams({ mode: 'edit' }); - if (this.amountInput) { setTimeout(() => { const { current } = this.amountInput; From 297bedadc3fef5f12f1fb621a70dc823254da5d2 Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Thu, 14 May 2020 18:30:10 -0400 Subject: [PATCH 2/5] works --- app/components/UI/Navbar/index.js | 7 ++++--- .../Views/PaymentChannel/PaymentChannelDeposit/index.js | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/components/UI/Navbar/index.js b/app/components/UI/Navbar/index.js index a42f1a3942e..9abbf00e7b4 100644 --- a/app/components/UI/Navbar/index.js +++ b/app/components/UI/Navbar/index.js @@ -325,15 +325,16 @@ export function getPaymentRequestSuccessOptionsTitle(navigation) { export function getTransactionOptionsTitle(_title, navigation) { const transactionMode = navigation.getParam('mode', ''); const { routeName } = navigation.state; - const leftText = transactionMode === 'edit' ? strings('transaction.edit') : strings('transaction.cancel'); + const leftText = transactionMode === 'edit' ? strings('transaction.cancel') : strings('transaction.edit'); const disableModeChange = navigation.getParam('disableModeChange'); const modeChange = navigation.getParam('dispatch', () => { ''; }); + console.log('routeName', routeName); const leftAction = () => modeChange('edit'); const rightAction = () => navigation.pop(); const rightText = strings('transaction.cancel'); - const title = transactionMode === 'edit' ? 'transaction.edit' : _title; + const title = transactionMode === 'edit' && routeName !== 'PaymentChannelDeposit' ? 'transaction.edit' : _title; return { headerTitle: , headerLeft: @@ -355,7 +356,7 @@ export function getTransactionOptionsTitle(_title, navigation) { ), headerRight: - routeName === 'Send' ? ( + routeName === 'Send' || routeName === 'PaymentChannelDeposit' ? ( // eslint-disable-next-line react/jsx-no-bind {rightText} diff --git a/app/components/Views/PaymentChannel/PaymentChannelDeposit/index.js b/app/components/Views/PaymentChannel/PaymentChannelDeposit/index.js index 4e6e56a9f3e..47b3528f18c 100644 --- a/app/components/Views/PaymentChannel/PaymentChannelDeposit/index.js +++ b/app/components/Views/PaymentChannel/PaymentChannelDeposit/index.js @@ -240,6 +240,8 @@ class Deposit extends PureComponent { amountInput = React.createRef(); componentDidMount = () => { + const { navigation } = this.props; + navigation && navigation.setParams({ mode: 'edit' }); if (this.amountInput) { setTimeout(() => { const { current } = this.amountInput; From b2bd9478e0eb80c5b44b8817bce90d0ac874b8da Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Thu, 14 May 2020 18:32:01 -0400 Subject: [PATCH 3/5] rm log --- app/components/UI/Navbar/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/components/UI/Navbar/index.js b/app/components/UI/Navbar/index.js index 9abbf00e7b4..70e85da6fe7 100644 --- a/app/components/UI/Navbar/index.js +++ b/app/components/UI/Navbar/index.js @@ -330,7 +330,6 @@ export function getTransactionOptionsTitle(_title, navigation) { const modeChange = navigation.getParam('dispatch', () => { ''; }); - console.log('routeName', routeName); const leftAction = () => modeChange('edit'); const rightAction = () => navigation.pop(); const rightText = strings('transaction.cancel'); From b75455e3847a655034b29a56b1d678cac71abbd5 Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Thu, 14 May 2020 18:35:35 -0400 Subject: [PATCH 4/5] add this to changelog and update date --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 524a38a187d..4cc1843efed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## Current Develop Branch -## v0.2.16 - May 13 2020 +## v0.2.16 - May 15 2020 +- [#1582](https://github.com/MetaMask/metamask-mobile/pull/1582): Instapay deposit navbar cancel (#1582) - [#1570](https://github.com/MetaMask/metamask-mobile/pull/1570): Disable confirm screen edit button when no tokens of a payment request (#1570) - [#1574](https://github.com/MetaMask/metamask-mobile/pull/1574): Ensure collectibles that use 'transfer' method show a fee in tx history list (#1574) - [#1565](https://github.com/MetaMask/metamask-mobile/pull/1565): Fix validating of amount when sending a collectible (#1565) From 328d56a8f684d373bc6c27f75c1f063b21de4c3e Mon Sep 17 00:00:00 2001 From: Esteban Mino Date: Thu, 14 May 2020 18:53:52 -0400 Subject: [PATCH 5/5] amount title --- app/components/Views/SendFlow/Amount/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/Views/SendFlow/Amount/index.js b/app/components/Views/SendFlow/Amount/index.js index 40540d9403c..645bcb4c925 100644 --- a/app/components/Views/SendFlow/Amount/index.js +++ b/app/components/Views/SendFlow/Amount/index.js @@ -285,7 +285,7 @@ const styles = StyleSheet.create({ */ class Amount extends PureComponent { static navigationOptions = ({ navigation, screenProps }) => - getSendFlowTitle('send.confirm', navigation, screenProps); + getSendFlowTitle('send.amount', navigation, screenProps); static propTypes = { /**