From cfc058f5f0818cbab00973d4761386284459db46 Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Sat, 4 Nov 2023 11:35:21 +0530 Subject: [PATCH 01/12] Add popover with overlay to confirm Bank Account deletion --- src/pages/settings/Wallet/WalletPage/WalletPage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 2387f5f23e6c..5d89f8a6943c 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -5,7 +5,6 @@ import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import AddPaymentMethodMenu from '@components/AddPaymentMethodMenu'; import Button from '@components/Button'; -import ConfirmContent from '@components/ConfirmContent'; import CurrentWalletBalance from '@components/CurrentWalletBalance'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import Icon from '@components/Icon'; @@ -37,6 +36,7 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import {defaultProps, propTypes} from './walletPagePropTypes'; +import ConfirmModal from '@components/ConfirmModal'; function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymentMethods, network, shouldListenForResize, userWallet, walletTerms}) { const {translate} = useLocalize(); @@ -513,7 +513,8 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen /> ) : ( - { deletePaymentMethod(); hideDefaultDeleteMenu(); From c098335efbcd8855489501cad4cea03e5e36993e Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Mon, 6 Nov 2023 23:17:49 +0530 Subject: [PATCH 02/12] lint fix --- src/pages/settings/Wallet/WalletPage/WalletPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 5d89f8a6943c..1b6e70b5e807 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -5,6 +5,7 @@ import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import AddPaymentMethodMenu from '@components/AddPaymentMethodMenu'; import Button from '@components/Button'; +import ConfirmModal from '@components/ConfirmModal'; import CurrentWalletBalance from '@components/CurrentWalletBalance'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import Icon from '@components/Icon'; @@ -36,7 +37,6 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import {defaultProps, propTypes} from './walletPagePropTypes'; -import ConfirmModal from '@components/ConfirmModal'; function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymentMethods, network, shouldListenForResize, userWallet, walletTerms}) { const {translate} = useLocalize(); From 9f464234cb9ef4a702311b214e7d248b726457da Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Thu, 16 Nov 2023 17:24:05 +0530 Subject: [PATCH 03/12] Move onModalHide to ConfirmModal prop --- src/pages/settings/Wallet/WalletPage/WalletPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 1b6e70b5e807..35ce5dd5158e 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -481,7 +481,6 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen }} withoutOverlay anchorRef={paymentMethodButtonRef} - onModalHide={resetSelectedPaymentMethodData} > {!showConfirmDeleteContent ? ( @@ -531,6 +530,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen }} shouldShowCancelButton danger + onModalHide={resetSelectedPaymentMethodData} /> )} From 146570deef4aa0db98d4fe45990cdfcad01e9642 Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Thu, 16 Nov 2023 17:35:05 +0530 Subject: [PATCH 04/12] Improve Confirm Modal Visibility logic --- .../settings/Wallet/WalletPage/WalletPage.js | 80 +++++++++---------- 1 file changed, 36 insertions(+), 44 deletions(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 35ce5dd5158e..780c6d767c12 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -482,60 +482,52 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen withoutOverlay anchorRef={paymentMethodButtonRef} > - {!showConfirmDeleteContent ? ( - - {isPopoverBottomMount && ( - - )} - {shouldShowMakeDefaultButton && ( -