diff --git a/src/components/FeatureList.tsx b/src/components/FeatureList.tsx index 53f42956d834..f46b289b88d7 100644 --- a/src/components/FeatureList.tsx +++ b/src/components/FeatureList.tsx @@ -54,7 +54,7 @@ function FeatureList({ menuItems, illustration, illustrationStyle, - illustrationBackgroundColor = '', + illustrationBackgroundColor, }: FeatureListProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx index faecf55a0c4a..cfb7cffb2799 100644 --- a/src/components/MenuItem.tsx +++ b/src/components/MenuItem.tsx @@ -79,6 +79,9 @@ type MenuItemBaseProps = { /** Used to apply styles specifically to the title */ titleStyle?: ViewStyle; + /** Any additional styles to apply on the badge element */ + badgeStyle?: ViewStyle; + /** Any adjustments to style when menu item is hovered or pressed */ hoverAndPressStyle?: StyleProp>; @@ -246,6 +249,7 @@ function MenuItem( titleStyle, hoverAndPressStyle, descriptionTextStyle, + badgeStyle, viewMode = CONST.OPTION_MODE.DEFAULT, numberOfLinesTitle = 1, icon, @@ -564,7 +568,12 @@ function MenuItem( {badgeText && ( )} {/* Since subtitle can be of type number, we should allow 0 to be shown */} diff --git a/src/pages/settings/Wallet/PaymentMethodList.js b/src/pages/settings/Wallet/PaymentMethodList.js index 0c708442cec6..35c2e5b4cb33 100644 --- a/src/pages/settings/Wallet/PaymentMethodList.js +++ b/src/pages/settings/Wallet/PaymentMethodList.js @@ -96,6 +96,9 @@ const propTypes = { /** List container style */ style: stylePropTypes, + + /** List item style */ + listItemStyle: stylePropTypes, }; const defaultProps = { @@ -120,6 +123,7 @@ const defaultProps = { onListContentSizeChange: () => {}, shouldEnableScroll: true, style: {}, + listItemStyle: {}, shouldShowSelectedState: false, }; @@ -205,6 +209,7 @@ function PaymentMethodList({ onListContentSizeChange, shouldEnableScroll, style, + listItemStyle, }) { const styles = useThemeStyles(); const StyleUtils = useStyleUtils(); @@ -264,9 +269,12 @@ function PaymentMethodList({ return { ...paymentMethod, + iconRight: Expensicons.ThreeDots, + shouldShowRightIcon: true, onPress: (e) => onPress(e, paymentMethod.accountType, paymentMethod.accountData, paymentMethod.isDefault, paymentMethod.methodID), wrapperStyle: isMethodActive ? [StyleUtils.getButtonBackgroundColorStyle(CONST.BUTTON_STATES.PRESSED)] : null, disabled: paymentMethod.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, + isMethodActive, }; }); @@ -286,12 +294,13 @@ function PaymentMethodList({ onPress={onPress} title={translate('walletPage.addBankAccount')} icon={Expensicons.Plus} - wrapperStyle={styles.paymentMethod} + wrapperStyle={[styles.paymentMethod, listItemStyle]} + hoverAndPressStyle={styles.hoveredComponentBG} ref={buttonRef} /> ), - [onPress, styles.paymentMethod, translate, buttonRef], + [onPress, translate, styles.paymentMethod, styles.hoveredComponentBG, listItemStyle, buttonRef], ); /** @@ -322,17 +331,21 @@ function PaymentMethodList({ iconWidth={item.iconWidth || item.iconSize} iconStyles={item.iconStyles} badgeText={shouldShowDefaultBadge(filteredPaymentMethods, item.isDefault) ? translate('paymentMethodList.defaultPaymentMethod') : null} - wrapperStyle={styles.paymentMethod} + wrapperStyle={[styles.paymentMethod, listItemStyle]} + iconRight={item.iconRight} + badgeStyle={styles.badgeBordered} + hoverAndPressStyle={styles.hoveredComponentBG} shouldShowRightIcon={item.shouldShowRightIcon} shouldShowSelectedState={shouldShowSelectedState} isSelected={selectedMethodID === item.methodID} interactive={item.interactive} brickRoadIndicator={item.brickRoadIndicator} + success={item.isMethodActive} /> ), - [styles.ph6, styles.paymentMethod, filteredPaymentMethods, translate, shouldShowSelectedState, selectedMethodID], + [styles.ph6, styles.paymentMethod, styles.badgeBordered, styles.hoveredComponentBG, filteredPaymentMethods, translate, listItemStyle, shouldShowSelectedState, selectedMethodID], ); return ( diff --git a/src/pages/settings/Wallet/WalletPage/WalletPage.js b/src/pages/settings/Wallet/WalletPage/WalletPage.js index 1ba414ef7ebd..fe9b997aadd2 100644 --- a/src/pages/settings/Wallet/WalletPage/WalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/WalletPage.js @@ -97,9 +97,9 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod const position = getClickedTargetLocation(paymentMethodButtonRef.current); setAnchorPosition({ - anchorPositionTop: position.top + position.height + variables.addPaymentPopoverTopSpacing, + anchorPositionTop: position.top + position.height - variables.bankAccountActionPopoverTopSpacing, // We want the position to be 23px to the right of the left border - anchorPositionRight: windowWidth - position.right - variables.addBankAccountLeftSpacing, + anchorPositionRight: windowWidth - position.right + variables.bankAccountActionPopoverRightSpacing, anchorPositionHorizontal: position.x + (shouldShowEmptyState ? -variables.addPaymentMethodLeftSpacing : variables.addBankAccountLeftSpacing), anchorPositionVertical: position.y, }); @@ -344,7 +344,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod icon={Illustrations.MoneyIntoWallet} shouldShowBackButton={isSmallScreenWidth} /> - + {hasWallet && (
<> {shouldShowLoadingSpinner ? ( @@ -373,7 +373,7 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod errors={walletTerms.errors} onClose={PaymentMethods.clearWalletTermsError} errorRowStyles={[styles.ml10, styles.mr2]} - style={[styles.mt7, styles.mb5]} + style={[styles.mt7, styles.mb5, styles.alignSelfStart]} > @@ -457,10 +457,10 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod )} {hasAssignedCard ? (
) : null}
{}} shouldEnableScroll={false} - style={styles.mt5} + style={[styles.mt5, [isSmallScreenWidth ? styles.mhn5 : styles.mhn8]]} + listItemStyle={isSmallScreenWidth ? styles.ph5 : styles.ph8} />
@@ -510,30 +512,32 @@ function WalletPage({bankAccountList, cardList, fundList, isLoadingPaymentMethod anchorRef={paymentMethodButtonRef} > {!showConfirmDeleteModal && ( - + {isPopoverBottomMount && ( )} {shouldShowMakeDefaultButton && ( -