wp-calypso
wp-calypso copied to clipboard
Checkout: Hide edit button when only one payment method exists
This is a follow up PR to #90240
In #90240 we added the credit amount to the WordPressFreePurchaseSummary
component to make the amount more obvious.
In this PR we are hiding the edit button for the Payment Method step if the step only contains one payment method - because editing a list of one isn't really possible.
Related to #88863
Before | After |
---|---|
Proposed Changes
- Hide the stepper's
HeaderEditButton
for the Payment Method step when - 1) thepaymentMethodStepIsActive
2) thepaymentMethods
array has a length of 1 or less
Testing Instructions
Regular purchases
- Add a renewal to your shopping cart, ensure the cart has valid payment methods
- Go to the Payment Method step and ensure that you see an edit link to change your payment method
- Make sure you can change methods via the edit link
Credit purchases
- Next, add enough credit to your account to cover the purchase completely
- Refresh checkout and go to Payment method step, it should show WordPress.com Credits $x.xx
- At this point there should not be an edit link next to the payment method step, but, there should be an edit link next to Billing Information
- Try to find some combination that breaks this PR