Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP Staging] Show Wallet Card in Wallet Page if User has Available Balance, Fix Wallet Page BG #30066

Merged
merged 6 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}
Comment on lines +38 to 39
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note no need to QA this as users will no longer see this screen since no user will have an empty wallet. We will remove this page in a follow up after the conference

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
Loading