Skip to content
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

Merged
merged 6 commits into from
Sep 6, 2021

Conversation

ScottAntonacAP
Copy link
Collaborator

Summary of Changes

  • add an enum for intro text options
  • update the fourPaymentsFormat string
  • add public introText to PriceBreakdownView
  • update README.md for introText options

Submission Checklist

Screenshots

AfterpayIntroText.NONE

Screen Shot 2021-09-02 at 2 27 12 pm

AfterpayIntroText.make

Screen Shot 2021-09-02 at 2 26 44 pm

AfterpayIntroText.payInTitle

Screen Shot 2021-09-02 at 12 57 19 pm

@benfterpay benfterpay changed the title add intro text options to price breakdown EIT-426: add intro text options to price breakdown Sep 2, 2021
import Foundation

public enum AfterpayIntroText: String {
case NONE = ""
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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)
Copy link
Contributor

@huwr huwr Sep 2, 2021

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:

Suggested change
string = String(format: Strings.fourPaymentsFormat, introText.rawValue, formattedPayment).trimmingCharacters(in: .whitespaces)
string = String(format: Strings.fourPaymentsFormat, introText.rawValue, formattedPayment)
.trimmingCharacters(in: .whitespaces)

Copy link
Contributor

@huwr huwr left a 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.

@ScottAntonacAP ScottAntonacAP merged commit 10487d0 into master Sep 6, 2021
@ScottAntonacAP ScottAntonacAP deleted the feature/intro-text branch September 6, 2021 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants