From dbb3f971b9a812cbea41b06547e65cc82423ee59 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 20 Oct 2023 11:04:09 +0100 Subject: [PATCH 1/6] Update to check if the userWallet is empty --- 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 37bb49952984..daf91012747e 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -61,7 +61,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen const [showConfirmDeleteContent, setShowConfirmDeleteContent] = useState(false); const hasBankAccount = !_.isEmpty(bankAccountList) || !_.isEmpty(fundList); - const hasWallet = userWallet.walletLinkedAccountID > 0; + const hasWallet = !_.isEmpty(userWallet); const hasActivatedWallet = _.contains([CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM], userWallet.tierName); const hasAssignedCard = !_.isEmpty(cardList); const shouldShowEmptyState = !hasBankAccount && !hasWallet && !hasAssignedCard; From 8e0425a065666dbeda9779c18151454d3cb722e5 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Fri, 20 Oct 2023 11:14:58 +0100 Subject: [PATCH 2/6] Show wallet if user hasa linkedAccountID OR if user has available funds --- 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 daf91012747e..48b4bfe18e1a 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -61,7 +61,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen const [showConfirmDeleteContent, setShowConfirmDeleteContent] = useState(false); const hasBankAccount = !_.isEmpty(bankAccountList) || !_.isEmpty(fundList); - const hasWallet = !_.isEmpty(userWallet); + const hasWallet = userWallet.walletLinkedAccountID !== 0 || userWallet.availableBalance > 0; const hasActivatedWallet = _.contains([CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM], userWallet.tierName); const hasAssignedCard = !_.isEmpty(cardList); const shouldShowEmptyState = !hasBankAccount && !hasWallet && !hasAssignedCard; From 3c096d99360a38b32cc6af725bca67608d29a3df Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Sat, 21 Oct 2023 19:09:54 +0100 Subject: [PATCH 3/6] Show wallet for all users, fix background color --- src/pages/settings/Wallet/WalletEmptyState.js | 3 ++- src/pages/settings/Wallet/WalletPage/WalletPage.js | 9 +-------- src/styles/themes/default.ts | 1 + 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/pages/settings/Wallet/WalletEmptyState.js b/src/pages/settings/Wallet/WalletEmptyState.js index adfd2cf49cee..f54716e3110a 100644 --- a/src/pages/settings/Wallet/WalletEmptyState.js +++ b/src/pages/settings/Wallet/WalletEmptyState.js @@ -9,6 +9,7 @@ import ROUTES from '../../../ROUTES'; import * as Illustrations from '../../../components/Icon/Illustrations'; import FeatureList from '../../../components/FeatureList'; import themeColors from '../../../styles/themes/default'; +import SCREENS from '../../../SCREENS'; const propTypes = { /** The function that is called when a menu item is pressed */ @@ -34,7 +35,7 @@ function WalletEmptyState({onAddPaymentMethod}) { const {translate} = useLocalize(); return ( Navigation.goBack(ROUTES.SETTINGS)} title={translate('common.wallet')} diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 48b4bfe18e1a..4f8624049ddf 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -61,7 +61,7 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen const [showConfirmDeleteContent, setShowConfirmDeleteContent] = useState(false); const hasBankAccount = !_.isEmpty(bankAccountList) || !_.isEmpty(fundList); - const hasWallet = userWallet.walletLinkedAccountID !== 0 || userWallet.availableBalance > 0; + const hasWallet = !_.isEmpty(userWallet); const hasActivatedWallet = _.contains([CONST.WALLET.TIER_NAME.GOLD, CONST.WALLET.TIER_NAME.PLATINUM], userWallet.tierName); const hasAssignedCard = !_.isEmpty(cardList); const shouldShowEmptyState = !hasBankAccount && !hasWallet && !hasAssignedCard; @@ -299,13 +299,6 @@ function WalletPage({bankAccountList, betas, cardList, fundList, isLoadingPaymen } }, [hideDefaultDeleteMenu, paymentMethod.methodID, paymentMethod.selectedPaymentMethodType, bankAccountList, fundList, shouldShowDefaultDeleteMenu]); - useEffect(() => { - if (!shouldShowEmptyState) { - return; - } - navigationRef.setParams({backgroundColor: themeColors.walletPageBG}); - }, [shouldShowEmptyState]); - const shouldShowMakeDefaultButton = !paymentMethod.isSelectedPaymentMethodDefault && Permissions.canUseWallet(betas) && diff --git a/src/styles/themes/default.ts b/src/styles/themes/default.ts index aabe9140bf9d..30fd5b5b6ebe 100644 --- a/src/styles/themes/default.ts +++ b/src/styles/themes/default.ts @@ -91,6 +91,7 @@ darkTheme.PAGE_BACKGROUND_COLORS = { [SCREENS.SAVE_THE_WORLD.ROOT]: colors.tangerine800, [SCREENS.SETTINGS.PREFERENCES]: colors.blue500, [SCREENS.SETTINGS.WORKSPACES]: colors.pink800, + [SCREENS.SETTINGS.WALLET]: colors.green700, [SCREENS.SETTINGS.SECURITY]: colors.ice500, [SCREENS.SETTINGS.STATUS]: colors.green700, [SCREENS.SETTINGS.ROOT]: darkTheme.sidebar, From 48432f99b872269f8043e40a6934c6ed04da4aec Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Sat, 21 Oct 2023 19:24:34 +0100 Subject: [PATCH 4/6] lint --- src/pages/settings/Wallet/WalletPage/WalletPage.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 4f8624049ddf..63cdf5259a18 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -6,7 +6,6 @@ import PaymentMethodList from '../PaymentMethodList'; import ROUTES from '../../../../ROUTES'; import HeaderWithBackButton from '../../../../components/HeaderWithBackButton'; import ScreenWrapper from '../../../../components/ScreenWrapper'; -import Navigation, {navigationRef} from '../../../../libs/Navigation/Navigation'; import styles from '../../../../styles/styles'; import compose from '../../../../libs/compose'; import * as BankAccounts from '../../../../libs/actions/BankAccounts'; From 19aabfaa09973ebbc6408b442f50d1448d3e5844 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Sat, 21 Oct 2023 19:31:12 +0100 Subject: [PATCH 5/6] Add accidentally removed import --- src/pages/settings/Wallet/WalletPage/WalletPage.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 63cdf5259a18..d1a2e4780f0d 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -6,6 +6,7 @@ import PaymentMethodList from '../PaymentMethodList'; import ROUTES from '../../../../ROUTES'; import HeaderWithBackButton from '../../../../components/HeaderWithBackButton'; import ScreenWrapper from '../../../../components/ScreenWrapper'; +import Navigation from '../../../../libs/Navigation/Navigation'; import styles from '../../../../styles/styles'; import compose from '../../../../libs/compose'; import * as BankAccounts from '../../../../libs/actions/BankAccounts'; From fbd364276c4c002b6db890e8614856bcfebfb68e Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Sat, 21 Oct 2023 19:42:09 +0100 Subject: [PATCH 6/6] fix IOS status bar --- src/styles/themes/default.ts | 2 +- src/styles/themes/light.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/themes/default.ts b/src/styles/themes/default.ts index 30fd5b5b6ebe..1dae2567d76e 100644 --- a/src/styles/themes/default.ts +++ b/src/styles/themes/default.ts @@ -91,7 +91,7 @@ darkTheme.PAGE_BACKGROUND_COLORS = { [SCREENS.SAVE_THE_WORLD.ROOT]: colors.tangerine800, [SCREENS.SETTINGS.PREFERENCES]: colors.blue500, [SCREENS.SETTINGS.WORKSPACES]: colors.pink800, - [SCREENS.SETTINGS.WALLET]: colors.green700, + [SCREENS.SETTINGS.WALLET]: colors.darkAppBackground, [SCREENS.SETTINGS.SECURITY]: colors.ice500, [SCREENS.SETTINGS.STATUS]: colors.green700, [SCREENS.SETTINGS.ROOT]: darkTheme.sidebar, diff --git a/src/styles/themes/light.ts b/src/styles/themes/light.ts index cd3079c3313f..3fa0e6937397 100644 --- a/src/styles/themes/light.ts +++ b/src/styles/themes/light.ts @@ -90,7 +90,7 @@ lightTheme.PAGE_BACKGROUND_COLORS = { [SCREENS.HOME]: lightTheme.sidebar, [SCREENS.SAVE_THE_WORLD.ROOT]: colors.tangerine800, [SCREENS.SETTINGS.PREFERENCES]: colors.blue500, - [SCREENS.SETTINGS.WALLET]: colors.green700, + [SCREENS.SETTINGS.WALLET]: colors.darkAppBackground, [SCREENS.SETTINGS.WORKSPACES]: colors.pink800, [SCREENS.SETTINGS.SECURITY]: colors.ice500, [SCREENS.SETTINGS.STATUS]: colors.green700,