Skip to content

Commit

Permalink
Fix: Hide seat counts and pricing for academia and unlimited plans (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikehrn authored Dec 12, 2024
1 parent 8197bb7 commit c6301f8
Showing 1 changed file with 36 additions and 24 deletions.
60 changes: 36 additions & 24 deletions packages/frontend-2/components/settings/workspaces/Billing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,38 @@
</p>
</div>
<div class="p-5 pt-4 flex flex-col gap-y-1">
<h3 class="text-body-xs text-foreground-2 pb-1">
{{
statusIsTrial
? 'Expected bill'
: subscription?.billingInterval === BillingInterval.Yearly
? 'Annual bill'
: 'Monthly bill'
}}
</h3>
<p class="text-heading-lg text-foreground inline-block">
{{ billValue }} per
{{
subscription?.billingInterval === BillingInterval.Yearly
? 'year'
: 'month'
}}
</p>
<p class="text-body-xs text-foreground-2 flex gap-x-1 items-center">
{{ billDescription }}
<InformationCircleIcon
v-tippy="billTooltip"
class="w-4 h-4 text-foreground cursor-pointer"
/>
</p>
<template v-if="isPurchasablePlan || statusIsTrial">
<h3 class="text-body-xs text-foreground-2 pb-1">
{{
statusIsTrial
? 'Expected bill'
: subscription?.billingInterval === BillingInterval.Yearly
? 'Annual bill'
: 'Monthly bill'
}}
</h3>
<p class="text-heading-lg text-foreground inline-block">
{{ billValue }} per
{{
subscription?.billingInterval === BillingInterval.Yearly
? 'year'
: 'month'
}}
</p>
<p class="text-body-xs text-foreground-2 flex gap-x-1 items-center">
{{ billDescription }}
<InformationCircleIcon
v-tippy="billTooltip"
class="w-4 h-4 text-foreground cursor-pointer"
/>
</p>
</template>
<template v-else>
<h3 class="text-body-xs text-foreground-2 pb-1">Expected bill</h3>
<p class="text-heading-lg text-foreground inline-block">
{{ isAcademiaPlan ? 'Free' : 'Not applicable' }}
</p>
</template>
</div>
<div class="p-5 pt-4 flex flex-col gap-y-1">
<h3 class="text-body-xs text-foreground-2 pb-1">
Expand Down Expand Up @@ -123,6 +131,7 @@
class="pt-4"
/>
<SettingsWorkspacesBillingPricingTable
v-if="isPurchasablePlan || statusIsTrial"
:workspace-id="workspaceId"
:current-plan="currentPlan"
:active-billing-interval="subscription?.billingInterval"
Expand Down Expand Up @@ -262,6 +271,9 @@ const isActivePlan = computed(
currentPlan.value?.status !== WorkspacePlanStatuses.Trial &&
currentPlan.value?.status !== WorkspacePlanStatuses.Canceled
)
const isAcademiaPlan = computed(
() => currentPlan.value?.name === WorkspacePlans.Academia
)
const isPurchasablePlan = computed(() => isPaidPlan(currentPlan.value?.name))
const seatPrice = computed(() =>
currentPlan.value && subscription.value
Expand Down

0 comments on commit c6301f8

Please sign in to comment.