[HOLD for payment 2021-11-05] Payments - add a fill background to "Add new payment method"
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Navigate to payments
- Click on "add new payment method"
Expected Result:
There should be a grey background the the payment methods menu is open.
Actual Result:
Background stays white.
Workaround:
None needed, visual issue.
Platform:
Where is this issue occurring?
- Web
- Desktop App
Version Number: 1.1.8-0
Reproducible in staging?: Yes Reproducible in production?: Yes
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Expensify/Expensify Issue URL:
Issue reported by: @Santhosh-Sellavel Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1634144802229400
Triggered auto assignment to @Beamanator (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Triggered auto assignment to @sylveawong (Design), see these Stack Overflow questions for more details.
Proposal
-
Pass a new prop
isAddPaymentMenuVisible={this.state.shouldShowAddPaymentMenu}toPaymentMethodListcomponent afterisLoadingPaymentsprop https://github.com/Expensify/App/blob/74b77a81d2c3fddee43b2c8b04802fed9251d96f/src/pages/settings/Payments/PaymentsPage.js#L127-L131 -
Small modification in addPaymentMethod object
combinedPaymentMethods.push({
type: MENU_ITEM,
title: this.props.translate('paymentMethodList.addPaymentMethod'),
icon: Plus,
onPress: e => this.props.onPress(e),
key: 'addPaymentMethodButton',
disabled: this.props.isLoadingPayments,
// ↓↓↓ THIS KEY ADDEDD
wrapperStyle: this.props.isShowAddPaymentMenuVisible && styles.switchInactive,
});
- Finally add
wrapperStyle={item.wrapperStyle}prop toMenuItemcomponent in here: https://github.com/Expensify/App/blob/74b77a81d2c3fddee43b2c8b04802fed9251d96f/src/pages/settings/Payments/PaymentMethodList.js#L153-L162
And of course I'll add new props to propTypes.
Edit: styles.switchInactive is for demo purposes and it can be changed any background color.
Hmm I'd like to get confirmation from @sylveawong that this is actually something we want to implement, before reviewing proposals. If it's something we'll fix / work on, I'll definitely mark this External.
@sylveawong it looks like this issue is proposing to give the "Add payment method" button a gray background when it is selected (a.k.a. when the user is choosing what type of payment method to add). A few questions for you:
- Do you think this is necessary / useful to add?
- If yes, what color gray would you recommend we make the background of the "Add payment method button"? Or would you recommend some other way to indicate that the button is "active"?
If you prefer, I can bring up this conversation in the Slack thread where this improvement was proposed 🤷 let me know!
Correct @Beamanator. There are other parts of the app that follow this Design pattern. Add secondary login (add a phone number) on the profile page. If we want to change this here. We should Update that part as well.
sorry! going to remove myself and @shawnborton / @michelle-thompson so they can get to this first!
I think we can just have it maintain its :hover state when it's actively showing a dropdown. Let me know if that makes sense.
Yeah that makes sense - the current styles we apply on hover, we'll now apply whenever it's "active" (when it gets clicked)
@parasharrajat I see what you mean, the "Add secondary login" button is quite similar to "Add payment method", but the "Add secondary login" button opens a new route (/settings/addlogin/phone) while "Add payment method" just opens a dropdown. I think it's fine to keep these different for the moment, what do you think @shawnborton ?
Proposal
This is the style method we use to set background in MenuItem
https://github.com/Expensify/App/blob/dd9e492ab67710848c9343fc6a47867f2fedd00f/src/styles/styles.js#L2334-L2338
We can pass CONST.BUTTON_STATES.ACTIVE and get the style and need to pass it as add new property here
https://github.com/Expensify/App/blob/dd9e492ab67710848c9343fc6a47867f2fedd00f/src/pages/settings/Payments/PaymentMethodList.js#L130-L136
wrapperStyle: this.props.isAddPaymentMenuActive ? [getButtonBackgroundColorStyle(CONST.BUTTON_STATES.ACTIVE)] : [],
iconFill: this.props.isAddPaymentMenuActive ? getIconFillColor(CONST.BUTTON_STATES.ACTIVE) : null,
And pass it along below, https://github.com/Expensify/App/blob/a142eb2fd137132a1f5278fca089c842c08cb243/src/pages/settings/Payments/PaymentMethodList.js#L153-L155
isAddPaymentMenuActive prop will added to PaymentMethodList component.
And pass prop,
isAddPaymentMenuActive={this.state.shouldShowAddPaymentMenu}
along with below lines https://github.com/Expensify/App/blob/e69f60377fb5ae0c486a0782680db7ad5b1d8c0e/src/pages/settings/Payments/PaymentsPage.js#L127-L129
For Button state: CONST.BUTTON_STATES.ACTIVE
For Button state: CONST.BUTTON_STATES.PRESSED
@shawnborton which looks good?
cc: @Beamanator
Forgot to attach the result for my proposal Here is result:
https://user-images.githubusercontent.com/11542415/137832141-9333afa3-d540-45a8-b372-f87483c587dc.mov
Triggered auto assignment to @bfitzexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Unassigning design team since decision was made here, removing n6-hold since the hold is over! Will review proposals soon
@shawnborton I just noticed this button technically has 3 states:
- Sitting alone
- Hovered
- Active (when being clicked)
Here's a vid showing all 3 - which do you prefer keeping when the menu is active? Also do we care about the + icon remaining solid black when the menu is open?:
https://user-images.githubusercontent.com/3885503/138003010-9667efaa-6867-4eba-8805-83a4e0096323.mov
Upwork posting
Hmm good find @Beamanator I think the :active state probably makes the most sense since the row is kind of "active" while the dropdown is shown. Thoughts?
Yeah I agree, I think "active" - also making sure the + sign is black, as it is when being clicked & hovered.
@Santhosh-Sellavel @kakajann can you both please update your proposals to include keeping the + icon black? I think in both of your solutions the background will be darker but the + icon changes back to gray
@Beamanator updated now!
That's how I would solve this anyway) as @Santhosh-Sellavel did. iconFill is simply enough. No advanced logic required
Thanks for the swift responses guys!
@Santhosh-Sellavel I will give this job to you, i like your use of existing style methods like getButtonBackgroundColorStyle and getIconFillColor, I also like the prop names you suggested. Please move forward with submitting a PR when you have a chance 👍
- Also please apply to the upwork job