-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Reward card IA updates #807
Conversation
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.
lgtm! 🚀
|
||
self.pillCollectionViewHidden.assertValues([false]) | ||
self.reloadPills.assertValues([ | ||
["4 days left", "50 backers", "Anywhere in the world"] |
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.
This is kind of an interesting case. I would think that if a reward isn't available anymore because remaining == 0
then it's pointless to show 4 days left
since it's unavailable anyway. cc @jamielynnroth
Not sure it's necessary to update it now but maybe something we can re-think later.
let endsAt = reward.endsAt, | ||
endsAt > 0, | ||
endsAt >= AppEnvironment.current.dateType.init().timeIntervalSince1970, | ||
reward.limit == nil || reward.remaining ?? 0 > 0 { |
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.
Can we extract this last piece to a var?
let isUnlimitedOrAvailable = reward.limit == nil || reward.remaining ?? 0 > 0
Come to think of it, you probably don't need the first part of that statement because if it's an "unlimited" reward then reward.remaining
will be nil
so you'll still get the same outcome. So:
let isAvailable = reward.remaining ?? 0 > 0
would suffice?
You're the expert on this though 😛
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 extracted it to a variable for readability.
Actually, we do need the OR, coalescing the nil remaining
value would assume it's a limited reward. We're saying - return the string if this reward is unlimited OR if it has more than 0 remaining. If the left side is nil
the second is ignored.
Tidied it up a little though.
Updated the strings to include remaining_count_left_of_limit_count:
zero: "%{remaining_count} left of %{limit_count}"
one: "%{remaining_count} left of %{limit_count}"
two: "%{remaining_count} left of %{limit_count}"
few: "%{remaining_count} left of %{limit_count}"
many: "%{remaining_count} left of %{limit_count}"
other: "%{remaining_count} left of %{limit_count}" This isn't necessary for this particular string as we don't vary the string based on the count. Also I'm not sure that it's built to handle multiple counts in the same string and looking through the rest of the yaml it's fairly inconsistent about that. 🤷♂ |
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.
Cool!
📲 What
Adds the IA changes that we wanted to get in for the reward card before shipping v1:
descriptionLabel
is positioned above theincludedItemsStackView
.descriptionTitleLabel
has been removed.sectionTitleLabelStyle
has been updated toksr_text_dark_grey_500
to improve accessibility.estimatedDeliveryDateLabel
appears belowincludedItemsStackView
.<remaining> left of <limit>
.👀 See
Abstract
Jira
Some examples:
✅ Acceptance criteria