-
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-205] Manage pledge reward section #868
Conversation
…here the view is being presented from
SwiftFormat found issues:
Generated by 🚫 Danger |
@@ -26,16 +24,51 @@ final class ManagePledgeViewController: UIViewController { | |||
) | |||
}() | |||
|
|||
private lazy var pledgeSummaryView: ManagePledgeSummaryView = { ManagePledgeSummaryView(frame: .zero) }() | |||
private lazy var navigationBarShadowImage: UIImage? = { |
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 doesn't seem to be referenced anywhere?
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.
(@justinswart ) This should be remove it since it's not being used. (Let's use a holistic approach to make the codebase consistent)
@@ -277,11 +275,14 @@ public final class RewardCardView: UIView { | |||
self.setNeedsLayout() | |||
} | |||
|
|||
fileprivate func load(items: [String]) { | |||
fileprivate func load(items: ([String], UIColor)) { |
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.
Could we name the tuple values here like fileprivate func load(items: (includedItems: [String], separatorBackgroundColo: UIColor)) {
, and then below refer to like items.includedItems
and items.separatorBackgroundColor
?
@@ -4329,7 +4329,7 @@ | |||
}; | |||
}; | |||
buildConfigurationList = A7E06C741C5A6EB300EBDCC2 /* Build configuration list for PBXProject "Kickstarter" */; | |||
compatibilityVersion = "Xcode 3.2"; | |||
compatibilityVersion = "Xcode 10.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.
Hmm what dis?
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.
Could we revert this line just because it seems unrelated?
@@ -107,6 +123,14 @@ public final class RewardCardViewModel: RewardCardViewModelType, RewardCardViewM | |||
: rewardsItem.item.name | |||
} | |||
} | |||
.combineLatest(with: context) |
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.
Ah cool, I don't use .combineLatest(with:)
often enough 🤔
// MARK: - Configuration | ||
|
||
public func configure(with value: (Project, Either<Reward, Backing>), context: RewardCardViewContext) { | ||
self.rewardView.configure(with: value, context: context) |
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.
(@justinswart )This view can pass the context itself
@@ -119,7 +168,9 @@ final class ManagePledgeViewController: UIViewController { | |||
|
|||
self.viewModel.outputs.configureRewardSummaryView | |||
.observeForUI() | |||
.observeValues { _ in } | |||
.observeValues { [weak self] in | |||
self?.rewardView.configure(with: $0, context: .pledgeView) |
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.
(@justinswart ) We don't need to pass the context here either
@@ -38,7 +38,7 @@ public final class RewardCardView: UIView { | |||
sectionInset: UIEdgeInsets(topBottom: Styles.grid(1)) | |||
) | |||
) | |||
|> \.backgroundColor .~ UIColor.white | |||
|> \.backgroundColor .~ self.backgroundColor |
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.
(@justinswart ) Let's move this line to bindStyles()
@@ -99,6 +111,10 @@ public final class RewardCardViewModel: RewardCardViewModelType, RewardCardViewM | |||
|
|||
self.includedItemsStackViewHidden = rewardItemsIsEmpty.skipRepeats() | |||
|
|||
let context = self.projectAndRewardOrBackingProperty.signal | |||
.skipNil() | |||
.map { $0.2 } |
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.
(@justinswart ) We can use .map(third)
here
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 this is looking good to go, one thing I'd like to just try to reverting the snapshots and trying to test against them again, I'm still not understanding why it's recorded new ones because there shouldn't be any change. Maybe the snapshot diff could tell us?
@@ -4329,7 +4329,7 @@ | |||
}; | |||
}; | |||
buildConfigurationList = A7E06C741C5A6EB300EBDCC2 /* Build configuration list for PBXProject "Kickstarter" */; | |||
compatibilityVersion = "Xcode 3.2"; | |||
compatibilityVersion = "Xcode 10.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.
Could we revert this line just because it seems unrelated?
@@ -160,6 +159,7 @@ public final class RewardCardView: UIView { | |||
self.pillCollectionView.rac.hidden = self.viewModel.outputs.pillCollectionViewHidden | |||
self.rewardTitleLabel.rac.hidden = self.viewModel.outputs.rewardTitleLabelHidden | |||
self.rewardTitleLabel.rac.text = self.viewModel.outputs.rewardTitleLabelText | |||
self.includedItemsTitleLabel.rac.textColor = self.viewModel.outputs.sectionTitleLabelTextColor |
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.
Just noticed here that the output name doesn't match the element that's being set?
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.
Good catch!
31ca55d
to
69b1e7b
Compare
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.
…kstarter/ios-oss into manage-pledge-reward-section
📲 What
🤔 Why
🛠 How
ManagePledgeRewardView
containing basically theRewardCardView
and a title label.RewardCardView
now needsRewardCardViewContext
to be configured properly, since little UI changes will occur depending if the reward is being seen from the Rewards Carousel or from the ManagePledgeViewControllerManagePledgeViewController
contains all the sections, snapshots were addedNote:
The
No Reward
title wasn't updated. This will be made in a small PR (coming soon) to avoid this PR to get too big.👀 See
Trello, screenshots, external resources?
♿️ Accessibility
✅ Acceptance criteria
Payment Methods
section.Selected reward