-
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-515] Rewards Carousel Creator View #925
Conversation
β¦their own 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.
Small suggestion but lgtm!
@@ -115,6 +115,8 @@ private func backingReward(fromProject project: Project) -> Reward? { | |||
} | |||
|
|||
private func pledgeButtonTitle(project: Project, reward: Reward) -> String? { | |||
guard !currentUserIsCreator(of: project) else { return nil } |
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 often find that using guard
s when the condition is negated is a little counter intuitive. Should we consider using if
?:
if currentUserIsCreator(of: project) { return nil }
self.pledgeButtonTitleText.assertValueCount(self.allRewards.count) | ||
|
||
self.gradientViewHidden.assertValues([false, false, false, false, false, false, false, false]) | ||
self.pledgeButtonStyleType.assertValues([.green, .green, .green, .green, .green, .green, .green, .green]) |
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.
π« | Line should be 110 characters or less: currently 111 charactersline_length RewardCardContainerViewModelTests.swift:206 |
Generated by π« Danger |
π² What
This makes the necessary changes to the rewards carousel for when a creator might be viewing their own project.
π€ Why
Currently they would see their own rewards as a normal backer but things would fail when they tried to pledge against their own project. Instead we're showing them a read only state of their rewards to improve this experience.
π How
func currentUserIsCreator(of project: Project) -> Bool
for determining whether the current user is a creator of a particular project.RewardCardContainerViewModel
to hide theSelect
button when a creator is viewing the rewards.RewardsCollectionViewModel
to return a title ofView your rewards
for the view when a creator is viewing it.π See
β Acceptance criteria
Create a project using your user on staging.
β° TODO