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

feat: add upgrade access button to user settings page #1398

Conversation

babblebey
Copy link
Contributor

@babblebey babblebey commented Jul 20, 2023

Description

This Pull Request adds the StripeCheckoutButton component to the User Settings page.

More Information in Review Comment HERE

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Fixes #1394

Mobile & Desktop Screenshots/Recordings

screencast-localhost_3000-2023.07.20-20_43_11.webm

Added tests?

  • πŸ‘ yes
  • πŸ™… no, because they aren't needed
  • πŸ™‹ no, because I need help

Added to documentation?

  • πŸ“œ README.md
  • πŸ““ docs.opensauced.pizza
  • πŸ• dev.to/opensauced
  • πŸ“• storybook
  • πŸ™… no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

NA

[optional] What gif best describes this PR or how it makes you feel?

@netlify
Copy link

netlify bot commented Jul 20, 2023

βœ… Deploy Preview for oss-insights ready!

Built without sensitive environment variables

Name Link
πŸ”¨ Latest commit f065db8
πŸ” Latest deploy log https://app.netlify.com/sites/oss-insights/deploys/64bbb5dbf4da38000847da4e
😎 Deploy Preview https://deploy-preview-1398--oss-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Jul 20, 2023

βœ… Deploy Preview for design-insights ready!

Name Link
πŸ”¨ Latest commit f065db8
πŸ” Latest deploy log https://app.netlify.com/sites/design-insights/deploys/64bbb5dbf4da38000847da50
😎 Deploy Preview https://deploy-preview-1398--design-insights.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@babblebey babblebey changed the title feat: add StripeCheckoutButton component to user-settings page feat: add upgrade access button to user settings page Jul 20, 2023
@babblebey babblebey marked this pull request as ready for review July 20, 2023 20:40
@babblebey
Copy link
Contributor Author

Changes Made to make the StripeCheckoutButton component more flexible:

  • Modified the StripeCheckoutButton component to accept children and props of type StripeCheckoutButtonProps. The children prop allows users to customize the text content of the button, while the props can be used to pass additional styling or behavior options.
  • Removed the unnecessary <div> element and replaced it with a <form> element to wrap the Button. This ensures better semantic structure for form submission.
  • Removed the redundant <p> element around the <form> element, as it is no longer necessary.
  • Updated the Button component usage to spread the props object so that any additional props provided to StripeCheckoutButton can be passed down to the Button component.

Overall, these changes have made the StripeCheckoutButton component more flexible and reusable, allowing users to easily customize the button's appearance and behavior based on their specific use cases. Sample Use Cases seen below

The dashboard Reports Component use case

<>
  <Text>Upgrade to a subscription to gain access to generate custom reports!</Text>
  <p className="flex justify-center py-4 px-2">
    // HERE
    <StripeCheckoutButton variant="primary" className="w-52 h-[38px] flex justify-center"/>
  </p>
</>

screenshot-localhost_3000-2023 07 21-11_30_31

The User Settings page use case

<div className="flex flex-col gap-6 order-first md:order-last">
  <div className="flex flex-col gap-3">
    <label className="text-2xl font-normal text-light-slate-11">Upgrade Access</label>
    <div className="w-full sm:max-w-[330px]">
      <Text>Upgrade to a subscription to gain access to generate custom reports!</Text>
    </div>
  </div>
  // HERE
  <StripeCheckoutButton variant="primary" />
</div>

screenshot-localhost_3000-2023 07 21-12_50_04

The User Settings page use case (with custom button content)

<StripeCheckoutButton variant="primary">
  Subscribe Now
</StripeCheckoutButton>

screenshot-localhost_3000-2023 07 21-12_51_39

babblebey and others added 2 commits July 21, 2023 12:54
…on.tsx

Co-authored-by: ( Nechiforel David-Samuel ) NsdHSO  <37635083+NsdHSO@users.noreply.github.com>
Co-authored-by: ( Nechiforel David-Samuel ) NsdHSO  <37635083+NsdHSO@users.noreply.github.com>
@brandonroberts
Copy link
Contributor

@babblebey changes look better. Got some build/test failures on the PR preview

@babblebey
Copy link
Contributor Author

changes look better. Got some build/test failures on the PR preview

I was out of sync with the new build configuration #1396

Now Fixed πŸ•

@brandonroberts
Copy link
Contributor

@babblebey thanks. One more addition is that button shouldn't be displayed if the user account already has access. The hasReports property from the useSession hook gives you this info https://github.com/open-sauced/insights/blob/beta/lib/hooks/useSession.ts#L43

Should be good to go then

@babblebey
Copy link
Contributor Author

thanks. One more addition is that button shouldn't be displayed if the user account already has access.

Haha, funny how I didn't think about that logic

Will do πŸ•

@brandonroberts brandonroberts merged commit 671ebf4 into open-sauced:beta Jul 24, 2023
11 checks passed
github-actions bot pushed a commit that referenced this pull request Jul 24, 2023
## [1.57.0-beta.4](v1.57.0-beta.3...v1.57.0-beta.4) (2023-07-24)

### πŸ› Bug Fixes

* flash of "test content" while loading in dashboard page ([#1409](#1409)) ([ad23f14](ad23f14))

### πŸ• Features

* add upgrade access button to user settings page ([#1398](#1398)) ([671ebf4](671ebf4))
* implemented hover and highlight contribution graph ([#1404](#1404)) ([0453370](0453370))
@github-actions
Copy link

πŸŽ‰ This PR is included in version 1.57.0-beta.4 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

github-actions bot pushed a commit that referenced this pull request Jul 24, 2023
## [1.57.0](v1.56.0...v1.57.0) (2023-07-24)

### πŸ€– Build System

* update eslint prettier config and setup commit hooks ([#1396](#1396)) ([ac9b276](ac9b276))

### πŸ” Continuous Integration

* disable husky for release ([2537649](2537649))
* fix husky command during release ([3e493a2](3e493a2))

### πŸ› Bug Fixes

* add `pullrequestLink` check into `HighlightInput` form `isDivFocused` condition ([#1406](#1406)) ([f3fda46](f3fda46))
* Auto-Scroll Not Triggered Upon Clicking 'Next Page' in Highlight… ([#1387](#1387)) ([77b161d](77b161d))
* flash of "test content" while loading in dashboard page ([#1409](#1409)) ([ad23f14](ad23f14))
* Improved the user experience of the highlights input form ([#1362](#1362)) ([2425dc4](2425dc4))
* Issue [#1374](#1374) All suggestions are being displayed with scroll area ([#1380](#1380)) ([1de56c7](1de56c7))
* Move card image api route ([#1401](#1401)) ([d650161](d650161))
* update top contributors response data ([#1397](#1397)) ([9053091](9053091))

### πŸ• Features

* add `[#100](#100 challenge anouncement to feeds ([#1389](#1389)) ([751dbbf](751dbbf))
* add 404 page ([#1390](#1390)) ([37bd475](37bd475))
* add discord link to user profile ([#1370](#1370)) ([f94bc3b](f94bc3b))
* Add links to getting started docs ([#1395](#1395)) ([c58cc80](c58cc80))
* add upgrade access button to user settings page ([#1398](#1398)) ([671ebf4](671ebf4))
* implement improved highlights form with ai auto-summarise ([#1381](#1381)) ([023f576](023f576))
* implemented hover and highlight contribution graph ([#1404](#1404)) ([0453370](0453370))
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.

Feature: Add upgrade access button to user settings page
5 participants