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

add more premim options #1282

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions components/Premium/BuyPremium/BuyPremium.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@
.purchaseCard :global(:not(.btn-check:checked)) + .priceRangeButton{
background-color: #2a3644;
border-color: #2a3644;
filter: grayscale(70%);
font-weight: bold;
color: lightgray;
}

/** Show the selected price option more clearly as selected **/
.purchaseCard :global(.btn-check:checked) + .priceRangeButton{
border-color: white;
font-weight: bold;
}
12 changes: 12 additions & 0 deletions components/Premium/BuyPremium/BuyPremium.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ function BuyPremium(props: Props) {
return durationString
}

function getPremiumToggleButtonStyle(premiumType: PremiumType) {
switch (premiumType.productId) {
case 'premium':
return { color: '#32de84' }
case 'premium_plus':
return { color: '#ffaa00' }
default:
return {}
}
}

return (
<>
<Card className={styles.purchaseCard}>
Expand All @@ -97,6 +108,7 @@ function BuyPremium(props: Props) {
className={styles.priceRangeButton}
size="lg"
variant="primary"
style={getPremiumToggleButtonStyle(premiumType)}
>
{premiumType.label}
</ToggleButton>
Expand Down
4 changes: 4 additions & 0 deletions utils/PremiumTypeUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ export const PREMIUM_TYPES: PremiumType[] = [
priority: PREMIUM_RANK.PREMIUM_PLUS,
options: [
{ value: 1, label: '1 week', productId: 'premium_plus', price: 1800 },
{ value: 3, label: '3 weeks', productId: 'premium_plus', price: 1800 },
{ value: 4, label: '4 weeks', productId: 'premium_plus', price: 1800 },
{ value: 6, label: '6 weeks', productId: 'premium_plus', price: 1800 },
{ value: 12, label: '12 weeks', productId: 'premium_plus', price: 1800 },
{ value: 1, label: '1 hour', productId: 'premium_plus-hour', price: 200 },
{ value: 1, label: '1 day', productId: 'premium_plus-day', price: 600 }
]
Expand Down
Loading