Skip to content

Commit

Permalink
book a call link for copilot plan
Browse files Browse the repository at this point in the history
  • Loading branch information
elie222 committed Oct 20, 2024
1 parent 2b6adfc commit 97a8277
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
30 changes: 18 additions & 12 deletions apps/web/app/(app)/premium/Pricing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,24 @@ export function Pricing(props: { header?: React.ReactNode }) {

const user = session.data?.user;

const href = user
? isCurrentPlan
? "#"
: buildLemonUrl(
attachUserInfo(tier.href[frequency.value], {
id: user.id,
email: user.email!,
name: user.name,
}),
affiliateCode,
)
: "/login?next=/premium";
function getHref(): string {
if (!user) return "/login?next=/premium";

if (isCurrentPlan) return "#";

if (tier.ctaLink) return tier.ctaLink;

return buildLemonUrl(
attachUserInfo(tier.href[frequency.value], {
id: user.id,
email: user.email!,
name: user.name,
}),
affiliateCode,
);
}

const href = getHref();

return (
<div
Expand Down
4 changes: 3 additions & 1 deletion apps/web/app/(app)/premium/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ const copilotTier = {
"30-minute 1:1 monthly call",
"Full refund if not satisfied after first 3 days",
],
cta: "Upgrade",
cta: "Book a call",
ctaLink: env.NEXT_PUBLIC_CALL_LINK,
mostPopular: false,
};

Expand All @@ -164,6 +165,7 @@ export const tiers: {
description: string;
features: string[];
cta: string;
ctaLink?: string;
mostPopular?: boolean;
}[] = [
basicTier,
Expand Down

0 comments on commit 97a8277

Please sign in to comment.