fix(fe): show discounted monthly price when annual plan selected

This commit is contained in:
andrewwallacespeckle
2025-03-14 14:37:44 +00:00
parent 140fde3871
commit 9b99c7766d
@@ -13,7 +13,7 @@
</div>
<p class="text-body mt-1">
<span class="font-medium">
{{ formatPrice(planPrice?.[Roles.Workspace.Member]) }}
{{ formatPrice(finalPlanPrice) }}
</span>
per seat/month
</p>
@@ -141,6 +141,15 @@ const planPrice = computed(
prices.value?.[props.plan]?.[props.yearlyIntervalSelected ? 'yearly' : 'monthly']
)
const finalPlanPrice = computed(() => {
const basePrice = prices.value?.[props.plan].monthly?.['workspace:member']
if (!basePrice) return undefined
return {
...basePrice,
amount: props.yearlyIntervalSelected ? basePrice.amount * 0.8 : basePrice.amount
}
})
const hasCta = computed(() => !!slots.cta)
const canUpgradeToPlan = computed(() => {
if (!props.currentPlan) return false