Skip to content

Commit

Permalink
Merge pull request #30066 from Expensify/georgia-cardSettings-ShowWallet
Browse files Browse the repository at this point in the history
  • Loading branch information
thienlnam authored Oct 21, 2023
2 parents 6031f3e + fbd3642 commit dcb698f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 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
11 changes: 2 additions & 9 deletions src/pages/settings/Wallet/WalletPage/WalletPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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 Navigation from '../../../../libs/Navigation/Navigation';
import styles from '../../../../styles/styles';
import compose from '../../../../libs/compose';
import * as BankAccounts from '../../../../libs/actions/BankAccounts';
Expand Down 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;
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.darkAppBackground,
[SCREENS.SETTINGS.SECURITY]: colors.ice500,
[SCREENS.SETTINGS.STATUS]: colors.green700,
[SCREENS.SETTINGS.ROOT]: darkTheme.sidebar,
Expand Down
2 changes: 1 addition & 1 deletion src/styles/themes/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit dcb698f

Please sign in to comment.