Skip to content

Commit f3b5993

Browse files
committed
[Dashboard] Add 7-day free trial for Growth plan and Starter plan option
1 parent 950bbae commit f3b5993

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed

apps/dashboard/src/@/components/blocks/pricing-card.tsx

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ export const PricingCard: React.FC<PricingCardProps> = ({
6464
const remainingTrialDays =
6565
(activeTrialEndsAt ? remainingDays(activeTrialEndsAt) : 0) || 0;
6666

67+
// if the team has just signed up and has not subscribed yet, and the billing plan is growth, then they get a 7 day trial
68+
const has7DayTrial =
69+
remainingTrialDays === 0 &&
70+
billingStatus === "noPayment" &&
71+
billingPlan === "growth";
72+
6773
const handleCTAClick = () => {
6874
cta?.onClick?.();
6975
trackEvent({
@@ -97,6 +103,7 @@ export const PricingCard: React.FC<PricingCardProps> = ({
97103
{plan.title}
98104
</h3>
99105
{current && <Badge className="capitalize">Current plan</Badge>}
106+
{has7DayTrial && <Badge variant="success">7 Day Free Trial</Badge>}
100107
</div>
101108
<p className="max-w-[320px] text-muted-foreground text-sm">
102109
{plan.description}
@@ -108,15 +115,26 @@ export const PricingCard: React.FC<PricingCardProps> = ({
108115
{plan.isStartingPriceOnly && (
109116
<span className="text-muted-foreground text-xs">Starting at</span>
110117
)}
111-
<div className="flex items-center gap-2">
112-
<span className="font-semibold text-2xl text-foreground tracking-tight">
113-
${plan.price.toLocaleString()}
114-
</span>
115-
116-
{!isCustomPrice && (
117-
<span className="text-muted-foreground">/ month</span>
118-
)}
119-
</div>
118+
{has7DayTrial ? (
119+
<div className="flex flex-col items-start gap-0">
120+
<span className="font-bold text-2xl text-foreground tracking-tight">
121+
7 days free
122+
</span>
123+
<span className="text-muted-foreground text-sm">
124+
Then ${plan.price.toLocaleString()} / month
125+
</span>
126+
</div>
127+
) : (
128+
<div className="flex items-center gap-2">
129+
<span className="font-semibold text-2xl text-foreground tracking-tight">
130+
${plan.price.toLocaleString()}
131+
</span>
132+
133+
{!isCustomPrice && (
134+
<span className="text-muted-foreground">/ month</span>
135+
)}
136+
</div>
137+
)}
120138

121139
{remainingTrialDays > 0 && (
122140
<p className="text-muted-foreground text-sm">
@@ -155,7 +173,7 @@ export const PricingCard: React.FC<PricingCardProps> = ({
155173
teamSlug={teamSlug}
156174
sku={billingPlanToSkuMap[billingPlan]}
157175
>
158-
{cta.label}
176+
{has7DayTrial ? "Start 7 Day Free Trial" : cta.label}
159177
</CheckoutButton>
160178
)}
161179

@@ -166,7 +184,7 @@ export const PricingCard: React.FC<PricingCardProps> = ({
166184
asChild
167185
>
168186
<Link href={cta.href} target="_blank" onClick={handleCTAClick}>
169-
{cta.label}
187+
{has7DayTrial ? "Start 7 Day Free Trial" : cta.label}
170188
</Link>
171189
</Button>
172190
)}

apps/dashboard/src/app/(app)/login/onboarding/team-onboarding/InviteTeamMembers.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export function InviteTeamMembersUI(props: {
4949
await pollWithTimeout({
5050
shouldStop: async () => {
5151
const team = await props.getTeam();
52-
const isNonFreePlan = team.billingPlan !== "free";
52+
const isNonFreePlan =
53+
team.billingPlan !== "free" && team.billingPlan !== "starter";
5354

5455
if (isNonFreePlan) {
5556
props.trackEvent({
@@ -233,7 +234,7 @@ function InviteModalContent(props: {
233234
Choose a plan
234235
</SheetTitle>
235236
<SheetDescription className="text-left leading-relaxed">
236-
Get started with the free Starter plan or upgrade to Growth plan for
237+
Get started with the Starter plan or upgrade to Growth plan for
237238
increased limits and advanced features.{" "}
238239
<UnderlineLink href="https://thirdweb.com/pricing" target="_blank">
239240
Learn more about pricing

0 commit comments

Comments
 (0)