Skip to content

Commit

Permalink
Show wallet for all users, fix background color
Browse files Browse the repository at this point in the history
  • Loading branch information
grgia committed Oct 21, 2023
1 parent 8e0425a commit 3c096d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/pages/settings/Wallet/WalletEmptyState.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -34,7 +35,7 @@ function WalletEmptyState({onAddPaymentMethod}) {
const {translate} = useLocalize();
return (
<IllustratedHeaderPageLayout
backgroundColor={themeColors.walletPageBG}
backgroundColor={themeColors.PAGE_BACKGROUND_COLORS[SCREENS.SETTINGS.WALLET]}
illustration={LottieAnimations.FastMoney}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS)}
title={translate('common.wallet')}
Expand Down
9 changes: 1 addition & 8 deletions src/pages/settings/Wallet/WalletPage/WalletPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) &&
Expand Down
1 change: 1 addition & 0 deletions src/styles/themes/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3c096d9

Please sign in to comment.