-
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
[NT-404] No reward title #870
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.
Looks good, only had one suggestion for function name but should not block this PR.
@@ -181,17 +181,35 @@ private func backingReward(fromProject project: Project) -> Reward? { | |||
.coalesceWith(.noReward) | |||
} | |||
|
|||
private func rewardDescription(project: Project, reward: Reward) -> String { |
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.
In order to not repeat reward I'd suggest we rename this to something like localizedDescription(project: Project, reward: Reward)
so that it could be called like so map(localizedDescription(project:reward:))
. What do you think?
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 was wondering whether this would be more readable, but as soon as I posted it it seemed harder to read π€¦ββ
let isBacking = project.personalization.isBacking
let isNoReward = reward.isNoReward
let userHasBacked = userIsBacking(reward: reward, inProject: project)
switch (isBacking, isNoReward, userHasBacked) {
case (false, true, true):
return Strings.Thanks_for_bringing_this_project_one_step_closer_to_becoming_a_reality()
case (false, false, _):
return Strings.Back_it_because_you_believe_in_it()
case (true, true, _):
return Strings.Back_it_because_you_believe_in_it()
default:
return reward.description
}
@@ -115,7 +115,7 @@ final class RewardCardViewModelTests: TestCase { | |||
|
|||
self.rewardTitleLabelHidden.assertValues([false]) | |||
self.rewardTitleLabelText.assertValues([ | |||
"Thank you for supporting this project." | |||
"You pledged without a reward" |
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.
Would easily fit one line now
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.
Awesome work on this!! π³π³π³
π² What
No Reward
to reflect the design.π€ Why
Β―(Β°_o)/Β―
Abstract link
π How
RewardCardViewModel
π See
β Acceptance criteria
NoReward
should havePledge without a reward
as title andBack it because you believe in it.
as description.NoReward
should haveYou pledged without a reward
as title andThanks for bringing this project one step closer to becoming a reality.
as description.Note:
Since this PR is not merged yet, in order to see the backed
NoReward
please follow this steps:On
ProjectPamphletViewController.swift
, changed theprivate func goToManageViewPledge(project: Project, reward: Reward, refTag _: RefTag?)
to: