-
Notifications
You must be signed in to change notification settings - Fork 18
rewrote TierSelectionStep #1481
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
Open
matthias-luger
wants to merge
10
commits into
develop
Choose a base branch
from
rewrite-tier-selection-step
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dacea26
rewrote TierSelectionStep
matthias-luger 1392086
Potential fix for pull request finding
matthias-luger 90ae663
Potential fix for pull request finding
matthias-luger f017abe
fix country code select and remove "legacy"
matthias-luger 44731ad
QA fixes
matthias-luger 6d76469
Potential fix for pull request finding
matthias-luger aa4f5f4
Potential fix for pull request finding
matthias-luger 965ac33
Potential fix for pull request finding
matthias-luger 15e51b2
rewrite CountrySelect
matthias-luger 8c966f5
remove defaultCountry as its the same as selectedCountry
matthias-luger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
components/Premium/PremiumPurchaseWizard/Steps/TierCard.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import { ReactNode } from 'react' | ||
| import { Card } from 'react-bootstrap' | ||
| import styles from './Steps.module.css' | ||
| import { PremiumTier } from '../types' | ||
|
|
||
matthias-luger marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| export interface TierConfig { | ||
| tier: PremiumTier | ||
| icon: string | ||
| title: string | ||
| titleClass?: string | ||
| features: string[] | ||
| description: string | ||
| upgradeDescription?: string | ||
| } | ||
|
|
||
| export type TierStatus = 'current' | 'downgrade' | 'upgrade' | 'higher-upgrade' | '' | ||
|
|
||
| interface TierCardProps { | ||
| config: TierConfig | ||
| pricing: ReactNode | ||
| status: TierStatus | ||
| isSuggested: boolean | ||
| canSelect: boolean | ||
| onSelect: (tier: PremiumTier) => void | ||
| extraBadge?: string | ||
| suggestedFeature?: string | ||
| } | ||
|
|
||
| export default function TierCard({ config, pricing, status, isSuggested, canSelect, onSelect, extraBadge, suggestedFeature }: TierCardProps) { | ||
| const { tier, icon, title, titleClass, features, description, upgradeDescription } = config | ||
|
|
||
| const cardClassName = [ | ||
| styles.optionCard, | ||
| !canSelect && styles.disabled, | ||
| status === 'current' && styles.currentTier, | ||
| isSuggested && styles.suggested | ||
| ] | ||
| .filter(Boolean) | ||
| .join(' ') | ||
|
|
||
| return ( | ||
| <Card className={cardClassName} onClick={() => canSelect && onSelect(tier)}> | ||
| <Card.Body className={styles.optionBody}> | ||
matthias-luger marked this conversation as resolved.
Show resolved
Hide resolved
matthias-luger marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <div className={styles.optionIcon}>{icon}</div> | ||
| <h5 className={[styles.tierTitle, titleClass && styles[titleClass]].filter(Boolean).join(' ')}> | ||
| {title} | ||
| {status === 'current' && <span className={styles.currentBadge}>Current</span>} | ||
| {isSuggested && <span className={styles.suggestedBadge}>Recommended Upgrade</span>} | ||
| </h5> | ||
| <div className={styles.tierPrice}>{pricing}</div> | ||
| <p className={styles.tierDescription}>{isSuggested && upgradeDescription ? upgradeDescription : description}</p> | ||
| {extraBadge && !isSuggested && <small className={styles.recommendation}>{extraBadge}</small>} | ||
| {!canSelect && ( | ||
| <div className={styles.disabledOverlay}> | ||
| <small>Cannot downgrade</small> | ||
| </div> | ||
| )} | ||
| <ul className={styles.featureList}> | ||
| {features.map(feature => ( | ||
| <li key={feature}>{feature}</li> | ||
| ))} | ||
| {suggestedFeature && isSuggested && <li className={styles.newFeature}>{suggestedFeature}</li>} | ||
| </ul> | ||
| </Card.Body> | ||
| </Card> | ||
| ) | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.