From 33bd0ee1cf87c2c87cb468837b6508b12cc3971f Mon Sep 17 00:00:00 2001 From: Brandon Stites Date: Thu, 13 Jan 2022 14:42:46 -0700 Subject: [PATCH 1/2] Hide debit card behind wallet beta --- src/components/AddPaymentMethodMenu.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/components/AddPaymentMethodMenu.js b/src/components/AddPaymentMethodMenu.js index 986c4ea3c203..18e1f098106d 100644 --- a/src/components/AddPaymentMethodMenu.js +++ b/src/components/AddPaymentMethodMenu.js @@ -9,6 +9,7 @@ import styles from '../styles/styles'; import compose from '../libs/compose'; import ONYXKEYS from '../ONYXKEYS'; import CONST from '../CONST'; +import Permissions from "../libs/Permissions"; const propTypes = { isVisible: PropTypes.bool.isRequired, @@ -24,6 +25,9 @@ const propTypes = { /** Should we show the Paypal option */ shouldShowPaypal: PropTypes.bool, + /** List of betas available to current user */ + betas: PropTypes.arrayOf(PropTypes.string), + ...withLocalizePropTypes, }; @@ -45,12 +49,14 @@ const AddPaymentMethodMenu = props => ( onPress={() => props.onItemSelected(CONST.PAYMENT_METHODS.BANK_ACCOUNT)} wrapperStyle={styles.pr15} /> - props.onItemSelected(CONST.PAYMENT_METHODS.DEBIT_CARD)} - wrapperStyle={styles.pr15} - /> + {Permissions.canUseWallet(props.betas) && ( + props.onItemSelected(CONST.PAYMENT_METHODS.DEBIT_CARD)} + wrapperStyle={styles.pr15} + /> + )} {props.shouldShowPaypal && !props.payPalMeUsername && ( Date: Thu, 13 Jan 2022 14:57:11 -0700 Subject: [PATCH 2/2] Add default prop and fix style --- src/components/AddPaymentMethodMenu.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/AddPaymentMethodMenu.js b/src/components/AddPaymentMethodMenu.js index 18e1f098106d..c6d8679dda67 100644 --- a/src/components/AddPaymentMethodMenu.js +++ b/src/components/AddPaymentMethodMenu.js @@ -9,7 +9,7 @@ import styles from '../styles/styles'; import compose from '../libs/compose'; import ONYXKEYS from '../ONYXKEYS'; import CONST from '../CONST'; -import Permissions from "../libs/Permissions"; +import Permissions from '../libs/Permissions'; const propTypes = { isVisible: PropTypes.bool.isRequired, @@ -35,6 +35,7 @@ const defaultProps = { anchorPosition: {}, payPalMeUsername: '', shouldShowPaypal: true, + betas: [], }; const AddPaymentMethodMenu = props => (