Skip to content

Commit ab37887

Browse files
atrakhConvex, Inc.
authored andcommitted
dashboard: tidying ui for business plan (#43998)
GitOrigin-RevId: 7f994cb20ebee59694507173bce3606cd6131dbd
1 parent b05cb5b commit ab37887

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

npm-packages/dashboard/src/components/billing/TeamUsage.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,21 @@ export function TeamUsage({ team }: { team: TeamResponse }) {
132132

133133
const hasOrbSubscription = useHasSubscription(team?.id);
134134

135+
// Business plans don't have included usage, so treat them like there's no subscription
136+
const isBusinessPlan = subscription?.plan.planType === "CONVEX_BUSINESS";
137+
135138
const hasSubscription =
136139
(!shownBillingPeriod ||
137140
shownBillingPeriod.type === "currentBillingPeriod") &&
138141
(hasOrbSubscription || hasOrbSubscription === undefined) &&
139-
projectId === null;
142+
projectId === null &&
143+
!isBusinessPlan;
140144

141145
const showEntitlements =
142146
(!shownBillingPeriod ||
143147
shownBillingPeriod.type === "currentBillingPeriod") &&
144-
projectId === null;
148+
projectId === null &&
149+
!isBusinessPlan;
145150

146151
return (
147152
<div className="[--team-usage-toolbar-height:--spacing(32)] md:[--team-usage-toolbar-height:--spacing(28)] lg:[--team-usage-toolbar-height:--spacing(20)]">

npm-packages/dashboard/src/components/billing/planCards/OrbSelfServePlan.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ export function OrbSelfServePlan({
4444
};
4545

4646
const isDowngrade =
47-
orbSub?.plan.planType === "CONVEX_PROFESSIONAL" &&
48-
plan.planType === "CONVEX_STARTER_PLUS";
47+
(orbSub?.plan.planType === "CONVEX_PROFESSIONAL" &&
48+
plan.planType === "CONVEX_STARTER_PLUS") ||
49+
(orbSub?.plan.planType === "CONVEX_BUSINESS" &&
50+
(plan.planType === "CONVEX_STARTER_PLUS" ||
51+
plan.planType === "CONVEX_PROFESSIONAL"));
4952

5053
const changePlan = useChangeSubscription(team.id);
5154

0 commit comments

Comments
 (0)