-
Notifications
You must be signed in to change notification settings - Fork 10
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
EIT-426: add intro text options to price breakdown #175
Conversation
import Foundation | ||
|
||
public enum AfterpayIntroText: String { | ||
case NONE = "" |
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.
I think there's no reason for this to be SO SHOUTY. You can just use none
, or if you're trying to avoid confusion with Optional.none
you can use empty
?
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.
It was more the fact that it's the only option that doesn't actually align with its value... but I agree - the style isn't great. Will update to empty
.
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.
Addressed in 0a4e72a
- change shouty NONE to empty - clean up template string for better readibility and easier maintenance of intro text options
@@ -35,7 +38,7 @@ struct PriceBreakdown { | |||
|
|||
if let formattedPayment = formattedPayment, inRange { | |||
badgePlacement = .end | |||
string = String(format: Strings.fourPaymentsFormat, formattedPayment) | |||
string = String(format: Strings.fourPaymentsFormat, introText.rawValue, formattedPayment).trimmingCharacters(in: .whitespaces) |
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.
Only thing I'd ask now is for you to please put a new line in to quash the swiftlint warning, please:
string = String(format: Strings.fourPaymentsFormat, introText.rawValue, formattedPayment).trimmingCharacters(in: .whitespaces) | |
string = String(format: Strings.fourPaymentsFormat, introText.rawValue, formattedPayment) | |
.trimmingCharacters(in: .whitespaces) |
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.
Nice! Thanks for this. Other than the SwiftLint warning, merge when you like.
I can help you with the release procedure if you like (there is a doc in the repo for that) or you can make a new PR to do that.
Summary of Changes
fourPaymentsFormat
stringintroText
toPriceBreakdownView
README.md
forintroText
optionsSubmission Checklist
Screenshots
AfterpayIntroText.NONE
AfterpayIntroText.make
AfterpayIntroText.payInTitle