-
Notifications
You must be signed in to change notification settings - Fork 996
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
Refactor VerticalPaymentMethodListSelection -> RowButton.Type #4526
base: master
Are you sure you want to change the base?
Conversation
…han a map of RowButton -> Type
c5fcad7
to
afa36d4
Compare
StripeCore- public func caseInsensitiveContains(_ other: Swift.String) -> Swift.Bool
- @discardableResult
- public mutating func remove(_ element: Element) -> Element? If you are adding a new public API consider the following:
If you are modifying or removing a public API:
If you confirm these APIs need to be added/updated and have undergone necessary review, add the label ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with |
@@ -28,4 +28,11 @@ extension Array where Element: Equatable { | |||
guard let index = firstIndex(of: element) else { return nil } | |||
return remove(at: index) | |||
} | |||
|
|||
@discardableResult public mutating func replace(_ element: Element, with newElement: Element) -> Element? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like CI flagged this, but should be behind SPI.
Summary
This renames VerticalPaymentMethodListSelection to RowButton.Type and adds a
type
property to RowButton.Motivation
There was potential value in having RowButton be agnostic to whether it was a saved PM / new PM / Apple Pay / Link, in particular if we ever wanted to move it to StripeCore. But it's too useful for RowButton to hold onto its type and I don't think it's worse off for it. We can simplify
EmbeddedPaymentMethodsView
a lot with this change.Vertical mode could also benefit from this change but I'll leave that for another PR.
Testing
Existing tests, no new behavior
Changelog
Not user facing