Lint, make save button not clickable when quarterly is selected

This commit is contained in:
Prospector
2025-06-03 10:37:29 -07:00
parent 4441be5380
commit a4ba41bf15
6 changed files with 26 additions and 20 deletions

View File

@@ -309,7 +309,15 @@ defineExpose({
</button>
</ButtonStyled>
<ButtonStyled color="brand">
<button v-tooltip="currentStep === 'review' && !acceptedEula ? 'You must accept the Minecraft EULA to proceed.' : undefined" :disabled="!canProceed" @click="setStep(nextStep)">
<button
v-tooltip="
currentStep === 'review' && !acceptedEula
? 'You must accept the Minecraft EULA to proceed.'
: undefined
"
:disabled="!canProceed"
@click="setStep(nextStep)"
>
<template v-if="currentStep === 'review'">
<SpinnerIcon v-if="completingPurchase" class="animate-spin" />
<CheckCircleIcon v-else />

View File

@@ -217,7 +217,14 @@
v-if="interval === 'yearly' || interval === 'quarterly'"
class="rounded-full bg-brand px-2 py-1 font-bold text-brand-inverted"
>
SAVE {{ calculateSavings(price.prices.intervals.monthly, rawPrice, interval === 'quarterly' ? 3 : 12) }}%
SAVE
{{
calculateSavings(
price.prices.intervals.monthly,
rawPrice,
interval === 'quarterly' ? 3 : 12,
)
}}%
</span>
<span class="ml-auto text-lg" :class="{ 'text-secondary': selectedPlan !== interval }">
{{ formatPrice(locale, rawPrice, price.currency_code) }}

View File

@@ -1,6 +1,5 @@
<script setup lang="ts">
import type Stripe from 'stripe'
import ModalLoadingIndicator from '../modal/ModalLoadingIndicator.vue'
import { useVIntl, defineMessages } from '@vintl/vintl'
import PaymentMethodOption from './PaymentMethodOption.vue'

View File

@@ -177,13 +177,13 @@ function setInterval(newInterval: ServerBillingInterval) {
<RadioButtonIcon v-else class="size-6 text-secondary" />
<div class="flex flex-col items-start gap-1 font-medium text-primary">
<span class="flex items-center gap-1" :class="{ 'text-contrast': interval === 'quarterly' }"
>Pay quarterly
>Pay quarterly
<span class="text-xs font-bold text-brand px-1.5 py-0.5 rounded-full bg-brand-highlight"
>{{ interval === 'quarterly' ? 'Saving' : 'Save' }} 16%</span
>{{ interval === 'quarterly' ? 'Saving' : 'Save' }} 16%</span
></span
>
<span class="text-sm text-secondary flex items-center gap-1"
>{{
>{{
formatPrice(
locale,
prices?.prices?.intervals?.['quarterly'] ?? 0 / monthsInInterval['quarterly'],