Skip to content
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
2 changes: 1 addition & 1 deletion apps/dashboard/src/@/api/team.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type Team = {
billingPlan: "pro" | "growth" | "free" | "starter";
billingStatus: "validPayment" | (string & {}) | null;
billingEmail: string | null;
growthTrialEligible: boolean | null;
growthTrialEligible: false;
enabledScopes: EnabledTeamScope[];
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,18 @@ export const BillingPricing: React.FC<BillingPricingProps> = ({
}, [validTeamPlan]);

const growthCardCta: CtaLink | undefined = useMemo(() => {
const trialTitle = "Claim your 1-month free";

switch (validTeamPlan) {
// free > growth
case "free": {
return {
label: team.growthTrialEligible ? trialTitle : "Get started",
label: "Get started",
};
}

// starter > growth
case "starter": {
return {
label: team.growthTrialEligible ? trialTitle : "Upgrade",
label: "Upgrade",
};
}

Expand All @@ -87,7 +85,7 @@ export const BillingPricing: React.FC<BillingPricingProps> = ({
};
}
}
}, [team, validTeamPlan]);
}, [validTeamPlan]);

const proCta: CtaLink | undefined = useMemo(() => {
// pro > pro
Expand Down Expand Up @@ -138,20 +136,16 @@ export const BillingPricing: React.FC<BillingPricingProps> = ({
title: growthCardCta.label,
tracking: {
category: "account",
label: team.growthTrialEligible
? "claimGrowthTrial"
: "growthPlan",
label: "growthPlan",
},
variant: "default",
hint: team.growthTrialEligible
? "Your free trial will end after 30 days."
: undefined,
hint: undefined,
}
: undefined
}
canTrialGrowth={team.growthTrialEligible || false}
canTrialGrowth={false}
// upsell growth plan if user is on free plan
highlighted={validTeamPlan === "free"}
highlighted={validTeamPlan === "free" || validTeamPlan === "starter"}
teamSlug={team.slug}
redirectToCheckout={redirectToCheckout}
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/stories/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function teamStub(id: string, billingPlan: Team["billingPlan"]): Team {
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
billingEmail: "foo@example.com",
growthTrialEligible: true,
growthTrialEligible: false,
enabledScopes: [
"pay",
"storage",
Expand Down
2 changes: 1 addition & 1 deletion packages/service-utils/src/core/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type TeamResponse = {
updatedAt: Date | null;
billingEmail: string | null;
billingStatus: "noPayment" | "validPayment" | "invalidPayment" | null;
growthTrialEligible: boolean | null;
growthTrialEligible: false;
enabledScopes: ServiceName[];
};

Expand Down
Loading