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

[MBL-1207] Pledge Button on Project Page #1951

Merged
merged 6 commits into from Feb 22, 2024

Conversation

scottkicks
Copy link
Contributor

@scottkicks scottkicks commented Feb 20, 2024

this applies to PCP campaigns that backers have already pledged to

📲 What

Updates the pledge button on project pages to say "Back this project" when a campaign has Post-Campaign Pledging (PCP) enabled and is actively accepting late pledges.

In addition, I also made sure that the correct pledge button shows on rewards when in a PCP state. Right now, if a project isn't live or has already been backed, we don't show anything. Now, the pledge button will show when in an active PCP state if the user hasn't already backed.
If the user has already backed it, they'll see the normal "view your pledge" CTA that presents users with their pledge info.

🤔 Why

If PCP is disabled and a user has backed the campaign, we show a “View Rewards” button. For this feature, we want backers to be able to pledge post a successful campaign. It's important to note that backers should never be able to pledge more than once to any campaign

🛠 How

Let’s use the feature flag and the new PCP properties on the project fragment to gate this new behavior.

👀 See

Designs

✅ Acceptance criteria

  • If a campaign has PCP enabled and is actively accepting late pledges and users have not backed already, then the project should show the "Back this project" CTA
  • If a campaign has PCP enabled and is actively accepting late pledges and users have already pledged, then the project should show the "view your pledge" pledge CTA.
  • If a campaign has PCP disabled or is not actively accepting late pledges, then the normal pledge flow should be active

@scottkicks scottkicks force-pushed the mbl-1207-pcp-project-page-button branch 2 times, most recently from dec8fbe to 60ebf16 Compare February 20, 2024 17:29
@scottkicks scottkicks self-assigned this Feb 20, 2024
@scottkicks scottkicks added this to the release 5.13.0 milestone Feb 20, 2024
@scottkicks scottkicks force-pushed the mbl-1207-pcp-project-page-button branch from 60ebf16 to 8147602 Compare February 20, 2024 18:14
@scottkicks scottkicks force-pushed the mbl-1207-pcp-project-page-button branch from 8147602 to 7cd834a Compare February 20, 2024 18:41
@scottkicks scottkicks marked this pull request as ready for review February 20, 2024 19:04
Copy link
Contributor

@ifosli ifosli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like where this is headed, but I have some concerns. I've left comments. Also, I'm confused about this line: "If the user has already backed it, they'll see the normal "View Rewards" CTA" - if a user has backed a thing, they shouldn't see a "view rewards" CTA - they should see a "view your pledge" button. Can you make sure you test this scenario, if you haven't already?

Library/SharedFunctions.swift Outdated Show resolved Hide resolved
Library/RewardCellProjectBackingStateType.swift Outdated Show resolved Hide resolved
Library/RewardCellProjectBackingStateType.swift Outdated Show resolved Hide resolved
Library/ViewModels/PledgeCTAContainerViewViewModel.swift Outdated Show resolved Hide resolved
Library/ViewModels/RewardCardContainerViewModel.swift Outdated Show resolved Hide resolved
Library/ViewModels/RewardCardContainerViewModel.swift Outdated Show resolved Hide resolved
Copy link
Contributor

@ifosli ifosli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question but otherwise it looks good!

case (.successful, .errored):
case (.successful, _, true):
return .viewBacking
case (.successful, .errored, _):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could be wrong here, but I think a user could have an errored backing even if the project is in a post campaign state. If that's the case, we'd want to check the errored case first, in which case I don't think we actually need any custom post campaign logic at all?

@scottkicks scottkicks merged commit 519c399 into main Feb 22, 2024
5 checks passed
@scottkicks scottkicks deleted the mbl-1207-pcp-project-page-button branch February 22, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants