From dd599c4a8f41736225039e6f981dcec6bc9ceef6 Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Mon, 20 Jun 2022 21:31:41 +0300 Subject: [PATCH 1/4] educational modal should close when a network is added from popular network --- app/components/UI/DrawerView/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/components/UI/DrawerView/index.js b/app/components/UI/DrawerView/index.js index a39b548e161..52ee4f315e0 100644 --- a/app/components/UI/DrawerView/index.js +++ b/app/components/UI/DrawerView/index.js @@ -1199,6 +1199,12 @@ class DrawerView extends PureComponent { (item) => item.network === sanitizeUrl(switchedNetwork.networkUrl), ); + const networkInfo = showModal || + networkOnboarding.showNetworkOnboarding || + (currentRoute === 'WalletView' && + switchedNetwork.networkStatus && + checkIfCustomNetworkExists.length === 0) + return ( @@ -1365,7 +1371,7 @@ class DrawerView extends PureComponent { isVisible={ networkModalVisible || networkOnboarding.showNetworkOnboarding } - onBackdropPress={showModal ? null : this.toggleNetworksModal} + onBackdropPress={networkInfo ? null : this.toggleNetworksModal} onBackButtonPress={showModal ? null : this.toggleNetworksModa} onSwipeComplete={showModal ? null : this.toggleNetworksModa} swipeDirection={'down'} @@ -1373,11 +1379,7 @@ class DrawerView extends PureComponent { backdropColor={colors.overlay.default} backdropOpacity={1} > - {showModal || - networkOnboarding.showNetworkOnboarding || - (currentRoute === 'WalletView' && - switchedNetwork.networkStatus && - checkIfCustomNetworkExists.length === 0) ? ( + {networkInfo ? ( Date: Tue, 21 Jun 2022 12:00:45 +0300 Subject: [PATCH 2/4] network asset education modal shouldn't not be minimised without tapping on the CTA button --- app/components/UI/DrawerView/index.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/components/UI/DrawerView/index.js b/app/components/UI/DrawerView/index.js index 52ee4f315e0..99f0e6d46e4 100644 --- a/app/components/UI/DrawerView/index.js +++ b/app/components/UI/DrawerView/index.js @@ -1199,11 +1199,12 @@ class DrawerView extends PureComponent { (item) => item.network === sanitizeUrl(switchedNetwork.networkUrl), ); - const networkInfo = showModal || - networkOnboarding.showNetworkOnboarding || - (currentRoute === 'WalletView' && - switchedNetwork.networkStatus && - checkIfCustomNetworkExists.length === 0) + const canShowNetworkInfoModal = + showModal || + networkOnboarding.showNetworkOnboarding || + (currentRoute === 'WalletView' && + switchedNetwork.networkStatus && + checkIfCustomNetworkExists.length === 0); return ( @@ -1371,7 +1372,9 @@ class DrawerView extends PureComponent { isVisible={ networkModalVisible || networkOnboarding.showNetworkOnboarding } - onBackdropPress={networkInfo ? null : this.toggleNetworksModal} + onBackdropPress={ + canShowNetworkInfoModal ? null : this.toggleNetworksModal + } onBackButtonPress={showModal ? null : this.toggleNetworksModa} onSwipeComplete={showModal ? null : this.toggleNetworksModa} swipeDirection={'down'} @@ -1379,7 +1382,7 @@ class DrawerView extends PureComponent { backdropColor={colors.overlay.default} backdropOpacity={1} > - {networkInfo ? ( + {canShowNetworkInfoModal ? ( Date: Wed, 22 Jun 2022 15:25:49 +0300 Subject: [PATCH 3/4] refactor value into variable --- app/components/UI/DrawerView/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/components/UI/DrawerView/index.js b/app/components/UI/DrawerView/index.js index 99f0e6d46e4..b3d7d7f39cf 100644 --- a/app/components/UI/DrawerView/index.js +++ b/app/components/UI/DrawerView/index.js @@ -1199,12 +1199,15 @@ class DrawerView extends PureComponent { (item) => item.network === sanitizeUrl(switchedNetwork.networkUrl), ); + const networkSwitchedAndInWalletView = + currentRoute === 'WalletView' && + switchedNetwork.networkStatus && + checkIfCustomNetworkExists.length === 0; + const canShowNetworkInfoModal = showModal || networkOnboarding.showNetworkOnboarding || - (currentRoute === 'WalletView' && - switchedNetwork.networkStatus && - checkIfCustomNetworkExists.length === 0); + networkSwitchedAndInWalletView; return ( From f1f5aa7465e430cd0e9d35fa2a78b675d2b5597a Mon Sep 17 00:00:00 2001 From: Sylva Elendu Date: Wed, 22 Jun 2022 15:29:09 +0300 Subject: [PATCH 4/4] refactor value into variable --- app/components/UI/DrawerView/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/UI/DrawerView/index.js b/app/components/UI/DrawerView/index.js index b3d7d7f39cf..cd344f3b674 100644 --- a/app/components/UI/DrawerView/index.js +++ b/app/components/UI/DrawerView/index.js @@ -1162,7 +1162,7 @@ class DrawerView extends PureComponent { currentRoute, networkOnboarding, networkOnboardedState, - switchedNetwork, + switchedNetwork: { networkUrl, networkStatus }, networkModalVisible, } = this.props; const colors = this.context.colors || mockTheme.colors; @@ -1196,12 +1196,12 @@ class DrawerView extends PureComponent { const fiatBalanceStr = renderFiat(this.currentBalance, currentCurrency); const accountName = isDefaultAccountName(name) && ens ? ens : name; const checkIfCustomNetworkExists = networkOnboardedState.filter( - (item) => item.network === sanitizeUrl(switchedNetwork.networkUrl), + (item) => item.network === sanitizeUrl(networkUrl), ); const networkSwitchedAndInWalletView = currentRoute === 'WalletView' && - switchedNetwork.networkStatus && + networkStatus && checkIfCustomNetworkExists.length === 0; const canShowNetworkInfoModal =