Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

✨ Update pay wall dialog (#1896)

Luke Vella46a6be9224d8
diff --git a/CLAUDE.md b/CLAUDE.md
index 49795a7bf..ba598da7d 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -129,6 +129,11 @@ pnpm sherif # Check package dependencies
- React Context for client state (auth, preferences, etc.)
- Form state with react-hook-form + Zod validation
+### TypeScript Conventions
+- Prefer inline prop types over named interfaces for simple component props
+- Example: `function Component({ prop }: { prop: string })` instead of defining a separate interface
+- Only create named interfaces when they're reused or complex
+
### File Organization
- Features organized in `apps/web/src/features/[feature]/`
- Shared components in `apps/web/src/components/`
diff --git a/apps/landing/public/locales/en/pricing.json b/apps/landing/public/locales/en/pricing.json
index d6e73b3ef..545a77e3c 100644
--- a/apps/landing/public/locales/en/pricing.json
+++ b/apps/landing/public/locales/en/pricing.json
@@ -1,7 +1,6 @@
{
"pricingDescription": "Get started for free. No login required.",
"freeForever": "free forever",
- "planPro": "Pro",
"monthlyBillingDescription": "per month",
"upgrade": "Upgrade",
"faq": "Frequently Asked Questions",
@@ -23,7 +22,6 @@
"whyUpgradeAnswer2": "Upgrading to a paid plan makes sense if you use Rallly often or use it for work. The current subscription rate is a special early adopter rate and will increase in the future. By upgrading now, you will get early access to new, high-quality scheduling tools as they are released and lock in your subscription rate so you won't be affected by future price increases.",
"upgradeNowSaveLater": "Upgrade now, save later",
"earlyAdopterDescription": "As an early adopter, you'll lock in your subscription rate and won't be affected by future price increases.",
- "planFree": "Free",
"keepPollsIndefinitely": "Keep polls indefinitely",
"whenPollInactive": "When does a poll become inactive?",
"whenPollInactiveAnswer": "Polls become inactive when all date options are in the past AND the poll has not been accessed for over 30 days. Inactive polls are automatically deleted if you do not have a paid subscription.",
diff --git a/apps/landing/src/app/[locale]/(main)/pricing/pricing-table.tsx b/apps/landing/src/app/[locale]/(main)/pricing/pricing-table.tsx
index 797dbc37b..1f4887d56 100644
--- a/apps/landing/src/app/[locale]/(main)/pricing/pricing-table.tsx
+++ b/apps/landing/src/app/[locale]/(main)/pricing/pricing-table.tsx
@@ -1,6 +1,6 @@
"use client";
-import { pricingData } from "@rallly/billing/pricing";
+import { PLAN_NAMES, pricingData } from "@rallly/billing";
import { Badge } from "@rallly/ui/badge";
import {
BillingPlan,
@@ -49,9 +49,7 @@ export function PriceTables() {
<div className="mx-auto grid gap-4 sm:gap-6 md:grid-cols-2">
<BillingPlan>
<BillingPlanHeader>
- <BillingPlanTitle>
- <Trans t={t} ns="pricing" i18nKey="planFree" defaults="Free" />
- </BillingPlanTitle>
+ <BillingPlanTitle>{PLAN_NAMES.HOBBY}</BillingPlanTitle>
<BillingPlanDescription>
<Trans
t={t}
@@ -104,9 +102,7 @@ export function PriceTables() {
</BillingPlan>
<BillingPlan className="relative">
<BillingPlanHeader>
- <BillingPlanTitle>
- <Trans t={t} ns="pricing" i18nKey="planPro" defaults="Pro" />
- </BillingPlanTitle>
+ <BillingPlanTitle>{PLAN_NAMES.PRO}</BillingPlanTitle>
<BillingPlanDescription>
<Trans
t={t}
diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.json
index 8a47e2cbd..9ccfa782d 100644
--- a/apps/web/public/locales/en/app.json
+++ b/apps/web/public/locales/en/app.json
@@ -121,7 +121,6 @@
"dateAndTimeDescription": "Change your preferred date and time settings",
"createdTime": "Created {relativeTime}",
"planFree": "Free",
- "planPro": "Pro",
"Billing": "Billing",
"becomeATranslator": "Help translate",
"noPolls": "No polls",
@@ -185,7 +184,6 @@
"dangerZone": "Danger Zone",
"dangerZoneAccount": "Delete your account permanently. This action cannot be undone.",
"upgradePromptTitle": "Upgrade to Pro",
- "upgradeOverlaySubtitle3": "Unlock these feature by upgrading to a Pro plan.",
"home": "Home",
"create": "Create",
"upcoming": "Upcoming",
@@ -212,9 +210,6 @@
"featureNameDuplicate": "Duplicate Poll",
"featureNameAdvancedSettings": "Advanced Settings",
"featureNameExtendedPollLifetime": "Extended Poll Lifetime",
- "12months": "12 months",
- "savePercentage": "Save {percentage}%",
- "1month": "1 month",
"cancelAnytime": "Cancel anytime from your <a>billing page</a>.",
"unsubscribeToastTitle": "You have disabled notifications",
"unsubscribeToastDescription": "You will no longer receive notifications for this poll",
@@ -437,7 +432,6 @@
"billingPlanTitle": "Plan",
"billingSettings": "Billing Settings",
"billingSettingsDescription": "View and manage your space's subscription and billing information.",
- "planHobby": "Hobby",
"actionErrorServiceUnavailable": "The service required to perform this action is not available",
"actionErrorPayloadTooLarge": "The file you uploaded is too large. Please try a smaller file.",
"spaceName": "Space Name",
@@ -467,5 +461,26 @@
"attendeeCount": "{count, plural, =0 {No attendees} one {1 attendee} other {# attendees}}",
"participantCount": "{count, plural, one {1 participant} other {# participants}}",
"imageCropDialogTitle": "Crop Image",
- "cropPreview": "Crop preview"
+ "cropPreview": "Crop preview",
+ "annualSavings": "Save {amount} with yearly billing",
+ "annualDiscount": "Pay for {payMonths, number} months, get 12.",
+ "perSeatMonth": "/seat/mo",
+ "currentPlan": "Current Plan",
+ "planHobbyDescription": "For casual users",
+ "keyBenefits": "Key Benefits",
+ "basicPolls": "Basic Polls",
+ "basicPollsDescription": "Create simple scheduling polls",
+ "limitedPollLifetime": "Limited Poll Lifetime",
+ "limitedPollLifetimeDescription": "Inactive polls are automatically deleted",
+ "planProDescription": "For professionals and power users",
+ "finalizePollDescription": "Lock in the final meeting time and notify participants",
+ "duplicatePollDescription": "Quickly create similar polls from existing ones",
+ "advancedSettingsDescription": "Customize poll behavior and participant permissions",
+ "extendedPollLifetimeDescription": "Keep polls indefinitely",
+ "teamCollaboration": "Team Collaboration",
+ "teamCollaborationDescription": "Invite team members with centralized billing",
+ "instantAccess": "Instant access to all features",
+ "selectPlan": "Select Plan:",
+ "prioritySupport": "Priority Support",
+ "prioritySupportDescription": "Get faster response times and dedicated assistance"
}
diff --git a/apps/web/src/app/[locale]/(optional-space)/layout.tsx b/apps/web/src/app/[locale]/(optional-space)/layout.tsx
index 324c513e6..19d76250b 100644
--- a/apps/web/src/app/[locale]/(optional-space)/layout.tsx
+++ b/apps/web/src/app/[locale]/(optional-space)/layout.tsx
@@ -1,4 +1,5 @@
import { requireSpace } from "@/auth/data";
+import { BillingProvider } from "@/features/billing/client";
import { SpaceProvider } from "@/features/space/client";
import { auth } from "@/next-auth";
@@ -13,10 +14,10 @@ export default async function Layout({
const space = await requireSpace();
return (
<SpaceProvider data={space} userId={session.user.id}>
- {children}
+ <BillingProvider>{children}</BillingProvider>
</SpaceProvider>
);
}
- return children;
+ return <BillingProvider>{children}</BillingProvider>;
}
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/components/sidebar/nav-user.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/components/sidebar/nav-user.tsx
index f6f663ae4..ae7078863 100644
--- a/apps/web/src/app/[locale]/(space)/(dashboard)/components/sidebar/nav-user.tsx
+++ b/apps/web/src/app/[locale]/(space)/(dashboard)/components/sidebar/nav-user.tsx
@@ -4,17 +4,14 @@ import Link from "next/link";
import { usePathname } from "next/navigation";
import { OptimizedAvatarImage } from "@/components/optimized-avatar-image";
-import { isSpacesEnabled } from "@/features/space/constants";
export function NavUser({
name,
image,
- plan,
email,
}: {
name: string;
image?: string;
- plan?: React.ReactNode;
email: string;
}) {
const pathname = usePathname();
@@ -28,7 +25,7 @@ export function NavUser({
<div className="flex-1 truncate text-left">
<div className="font-medium">{name}</div>
<div className="mt-0.5 truncate font-normal text-muted-foreground text-xs">
- {isSpacesEnabled ? email : plan}
+ {email}
</div>
</div>
</Link>
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/components/sidebar/space-sidebar.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/components/sidebar/space-sidebar.tsx
index 44579a88c..af8aca8c6 100644
--- a/apps/web/src/app/[locale]/(space)/(dashboard)/components/sidebar/space-sidebar.tsx
+++ b/apps/web/src/app/[locale]/(space)/(dashboard)/components/sidebar/space-sidebar.tsx
@@ -14,13 +14,13 @@ import type React from "react";
import { LogoLink } from "@/app/components/logo-link";
import { requireSpace, requireUser } from "@/auth/data";
import { Trans } from "@/components/trans";
+import { PayWallButton } from "@/features/billing/client";
import { FeedbackToggle } from "@/features/feedback/components/feedback-toggle";
import { SpaceDropdown } from "@/features/space/components/space-dropdown";
import { SpaceIcon } from "@/features/space/components/space-icon";
import { SpaceTierLabel } from "@/features/space/components/space-tier";
import { isSpacesEnabled } from "@/features/space/constants";
import { loadSpaces } from "@/features/space/data";
-import { UpgradeButton } from "../upgrade-button";
import { NavUser } from "./nav-user";
import { SpaceSidebarMenu } from "./space-sidebar-menu";
@@ -106,28 +106,15 @@ export async function SpaceSidebar({
defaults="Unlock all Pro features"
/>
</p>
- <UpgradeButton>
- <Button variant="primary" className="w-full">
- <Trans i18nKey="upgrade" defaults="Upgrade" />
- </Button>
- </UpgradeButton>
+ <PayWallButton variant="primary" className="w-full">
+ <Trans i18nKey="upgrade" defaults="Upgrade" />
+ </PayWallButton>
</div>
</div>
<SidebarSeparator className="my-1" />
</>
) : null}
- <NavUser
- name={user.name}
- image={user.image}
- email={user.email}
- plan={
- activeSpace.tier === "pro" ? (
- <Trans i18nKey="planPro" defaults="Pro" />
- ) : (
- <Trans i18nKey="planFree" defaults="Free" />
- )
- }
- />
+ <NavUser name={user.name} image={user.image} email={user.email} />
</SidebarFooter>
</Sidebar>
);
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/components/upgrade-button.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/components/upgrade-button.tsx
deleted file mode 100644
index a01de3aac..000000000
--- a/apps/web/src/app/[locale]/(space)/(dashboard)/components/upgrade-button.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-"use client";
-
-import { DialogTrigger } from "@rallly/ui/dialog";
-
-import { PayWallDialog } from "@/components/pay-wall-dialog";
-
-export function UpgradeButton({ children }: React.PropsWithChildren) {
- return (
- <PayWallDialog>
- <DialogTrigger asChild>{children}</DialogTrigger>
- </PayWallDialog>
- );
-}
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/settings/billing/page.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/settings/billing/page.tsx
index 67321dcc8..80024be12 100644
--- a/apps/web/src/app/[locale]/(space)/(dashboard)/settings/billing/page.tsx
+++ b/apps/web/src/app/[locale]/(space)/(dashboard)/settings/billing/page.tsx
@@ -1,5 +1,4 @@
import { Button } from "@rallly/ui/button";
-import { DialogTrigger } from "@rallly/ui/dialog";
import { Icon } from "@rallly/ui/icon";
import { DotIcon, SendIcon, ShieldXIcon } from "lucide-react";
import type { Metadata } from "next";
@@ -19,9 +18,9 @@ import {
EmptyStateIcon,
EmptyStateTitle,
} from "@/components/empty-state";
-import { PayWallDialog } from "@/components/pay-wall-dialog";
import { StackedList, StackedListItem } from "@/components/stacked-list";
import { Trans } from "@/components/trans";
+import { PayWallButton } from "@/features/billing/client";
import { SubscriptionStatus } from "@/features/billing/components/subscription-status";
import { getSpaceSubscription } from "@/features/billing/data";
import {
@@ -119,13 +118,9 @@ export default async function BillingSettingsPage() {
</a>
</Button>
) : (
- <PayWallDialog>
- <DialogTrigger asChild>
- <Button>
- <Trans i18nKey="upgradeToPro" />
- </Button>
- </DialogTrigger>
- </PayWallDialog>
+ <PayWallButton>
+ <Trans i18nKey="upgradeToPro" />
+ </PayWallButton>
)}
</div>
</StackedListItem>
diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/settings/members/components/header.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/settings/members/components/header.tsx
index 4a2396ce8..c5e27621d 100644
--- a/apps/web/src/app/[locale]/(space)/(dashboard)/settings/members/components/header.tsx
+++ b/apps/web/src/app/[locale]/(space)/(dashboard)/settings/members/components/header.tsx
@@ -5,8 +5,8 @@ import { useDialog } from "@rallly/ui/dialog";
import { Icon } from "@rallly/ui/icon";
import { toast } from "@rallly/ui/sonner";
import { UserPlusIcon } from "lucide-react";
-import { PayWallDialog } from "@/components/pay-wall-dialog";
import { Trans } from "@/components/trans";
+import { useBilling } from "@/features/billing/client";
import { useSpace } from "@/features/space/client";
import { useTranslation } from "@/i18n/client";
import { InviteMemberDialog } from "./invite-member-dialog";
@@ -14,8 +14,8 @@ import { InviteMemberDialog } from "./invite-member-dialog";
export function InviteMemberButton() {
const { t } = useTranslation();
const inviteMemberDialog = useDialog();
- const payWallDialog = useDialog();
const space = useSpace();
+ const { showPayWall } = useBilling();
return (
<>
<Button
@@ -27,7 +27,7 @@ export function InviteMemberButton() {
}),
);
} else if (space.getAbility().cannot("invite", "Member")) {
- payWallDialog.trigger();
+ showPayWall();
} else {
inviteMemberDialog.trigger();
}
@@ -38,7 +38,6 @@ export function InviteMemberButton() {
</Icon>
<Trans i18nKey="inviteMember" defaults="Invite member" />
</Button>
- <PayWallDialog {...payWallDialog.dialogProps} />
<InviteMemberDialog {...inviteMemberDialog.dialogProps} />
</>
);
diff --git a/apps/web/src/app/[locale]/(space)/layout.tsx b/apps/web/src/app/[locale]/(space)/layout.tsx
index ebbe1cae7..01559a592 100644
--- a/apps/web/src/app/[locale]/(space)/layout.tsx
+++ b/apps/web/src/app/[locale]/(space)/layout.tsx
@@ -1,4 +1,5 @@
import { requireSpace, requireUser } from "@/auth/data";
+import { BillingProvider } from "@/features/billing/client";
import { SpaceProvider } from "@/features/space/client";
import { TimezoneProvider } from "@/lib/timezone/client/context";
@@ -20,9 +21,11 @@ export default async function Layout({
return (
<SpaceProvider data={space} userId={user.id}>
- <TimezoneProvider initialTimezone={user.timeZone}>
- {children}
- </TimezoneProvider>
+ <BillingProvider>
+ <TimezoneProvider initialTimezone={user.timeZone}>
+ {children}
+ </TimezoneProvider>
+ </BillingProvider>
</SpaceProvider>
);
}
diff --git a/apps/web/src/components/forms/poll-settings.tsx b/apps/web/src/components/forms/poll-settings.tsx
index aabf3dc1f..f0dc873dd 100644
--- a/apps/web/src/components/forms/poll-settings.tsx
+++ b/apps/web/src/components/forms/poll-settings.tsx
@@ -7,7 +7,6 @@ import {
CardHeader,
CardTitle,
} from "@rallly/ui/card";
-import { useDialog } from "@rallly/ui/dialog";
import { FormField } from "@rallly/ui/form";
import { Switch } from "@rallly/ui/switch";
import { AtSignIcon, EyeIcon, MessageCircleIcon, VoteIcon } from "lucide-react";
@@ -15,8 +14,8 @@ import type React from "react";
import { useFormContext } from "react-hook-form";
import { Trans } from "react-i18next";
-import { PayWallDialog } from "@/components/pay-wall-dialog";
import { ProBadge } from "@/components/pro-badge";
+import { useBilling } from "@/features/billing/client";
import { useSpace } from "@/features/space/client";
export type PollSettingsFormData = {
@@ -66,153 +65,150 @@ const Setting = ({ children }: React.PropsWithChildren) => {
export const PollSettingsForm = ({ children }: React.PropsWithChildren) => {
const form = useFormContext<PollSettingsFormData>();
const posthog = usePostHog();
- const paywallDialog = useDialog();
+ const { showPayWall } = useBilling();
const space = useSpace();
const isFree = space.data.tier === "hobby";
return (
- <>
- <Card>
- <CardHeader>
- <div className="flex justify-between gap-x-4">
- <div>
- <div className="flex items-center gap-x-2">
- <CardTitle>
- <Trans i18nKey="settings" />
- </CardTitle>
- </div>
- <CardDescription>
- <Trans
- i18nKey="pollSettingsDescription"
- defaults="Customize the behaviour of your poll"
- />
- </CardDescription>
+ <Card>
+ <CardHeader>
+ <div className="flex justify-between gap-x-4">
+ <div>
+ <div className="flex items-center gap-x-2">
+ <CardTitle>
+ <Trans i18nKey="settings" />
+ </CardTitle>
</div>
+ <CardDescription>
+ <Trans
+ i18nKey="pollSettingsDescription"
+ defaults="Customize the behaviour of your poll"
+ />
+ </CardDescription>
</div>
- </CardHeader>
- <CardContent>
- <div className={cn("grid gap-2.5")}>
- <FormField
- control={form.control}
- name="disableComments"
- render={({ field }) => (
- <Setting>
- <MessageCircleIcon className="size-5 shrink-0 translate-y-0.5" />
- <SettingContent>
- <SettingTitle htmlFor="disableComments">
- <Trans i18nKey="disableComments">Disable Comments</Trans>
- </SettingTitle>
- </SettingContent>
- <Switch
- id={field.name}
- checked={!!field.value}
- onCheckedChange={(checked) => {
+ </div>
+ </CardHeader>
+ <CardContent>
+ <div className={cn("grid gap-2.5")}>
+ <FormField
+ control={form.control}
+ name="disableComments"
+ render={({ field }) => (
+ <Setting>
+ <MessageCircleIcon className="size-5 shrink-0 translate-y-0.5" />
+ <SettingContent>
+ <SettingTitle htmlFor="disableComments">
+ <Trans i18nKey="disableComments">Disable Comments</Trans>
+ </SettingTitle>
+ </SettingContent>
+ <Switch
+ id={field.name}
+ checked={!!field.value}
+ onCheckedChange={(checked) => {
+ field.onChange(checked);
+ }}
+ />
+ </Setting>
+ )}
+ />
+ <FormField
+ control={form.control}
+ name="requireParticipantEmail"
+ render={({ field }) => (
+ <Setting>
+ <AtSignIcon className="size-5 shrink-0 translate-y-0.5" />
+ <SettingContent>
+ <SettingTitle pro>
+ <Trans
+ i18nKey="requireParticipantEmailLabel"
+ defaults="Make email address required for participants"
+ />
+ </SettingTitle>
+ </SettingContent>
+ <Switch
+ checked={!!field.value}
+ onCheckedChange={(checked) => {
+ if (isFree) {
+ showPayWall();
+ posthog?.capture("trigger paywall", {
+ setting: "require-participant-email",
+ from: "poll-settings",
+ });
+ } else {
field.onChange(checked);
- }}
- />
- </Setting>
- )}
- />
- <FormField
- control={form.control}
- name="requireParticipantEmail"
- render={({ field }) => (
- <Setting>
- <AtSignIcon className="size-5 shrink-0 translate-y-0.5" />
- <SettingContent>
- <SettingTitle pro>
- <Trans
- i18nKey="requireParticipantEmailLabel"
- defaults="Make email address required for participants"
- />
- </SettingTitle>
- </SettingContent>
- <Switch
- checked={!!field.value}
- onCheckedChange={(checked) => {
- if (isFree) {
- paywallDialog.trigger();
- posthog?.capture("trigger paywall", {
- setting: "require-participant-email",
- from: "poll-settings",
- });
- } else {
- field.onChange(checked);
- }
- }}
- />
- </Setting>
- )}
- />
- <FormField
- control={form.control}
- name="hideParticipants"
- render={({ field }) => (
- <Setting>
- <EyeIcon className="size-5 shrink-0 translate-y-0.5" />
- <SettingContent>
- <SettingTitle pro>
- <Trans
- i18nKey="hideParticipantsLabel"
- defaults="Hide participants from each other"
- />
- </SettingTitle>
- </SettingContent>
- <Switch
- checked={!!field.value}
- onCheckedChange={(checked) => {
- if (isFree) {
- paywallDialog.trigger();
- posthog?.capture("trigger paywall", {
- setting: "hide-participants",
- from: "poll-settings",
- });
- } else {
- field.onChange(checked);
- }
- }}
- />
- </Setting>
- )}
- />
- <FormField
- control={form.control}
- name="hideScores"
- render={({ field }) => (
- <Setting>
- <VoteIcon className="size-5 shrink-0 translate-y-0.5" />
- <SettingContent>
- <SettingTitle htmlFor={field.name} pro>
- <Trans
- i18nKey="hideScoresLabel"
- defaults="Hide scores until after a participant has voted"
- />
- </SettingTitle>
- </SettingContent>
- <Switch
- id={field.name}
- checked={!!field.value}
- onCheckedChange={(checked) => {
- if (isFree) {
- paywallDialog.trigger();
- posthog?.capture("trigger paywall", {
- setting: "hide-scores",
- from: "poll-settings",
- });
- } else {
- field.onChange(checked);
- }
- }}
- />
- </Setting>
- )}
- />
- </div>
- </CardContent>
- {children}
- </Card>
- <PayWallDialog {...paywallDialog.dialogProps} />
- </>
+ }
+ }}
+ />
+ </Setting>
+ )}
+ />
+ <FormField
+ control={form.control}
+ name="hideParticipants"
+ render={({ field }) => (
+ <Setting>
+ <EyeIcon className="size-5 shrink-0 translate-y-0.5" />
+ <SettingContent>
+ <SettingTitle pro>
+ <Trans
+ i18nKey="hideParticipantsLabel"
+ defaults="Hide participants from each other"
+ />
+ </SettingTitle>
+ </SettingContent>
+ <Switch
+ checked={!!field.value}
+ onCheckedChange={(checked) => {
+ if (isFree) {
+ showPayWall();
+ posthog?.capture("trigger paywall", {
+ setting: "hide-participants",
+ from: "poll-settings",
+ });
+ } else {
+ field.onChange(checked);
+ }
+ }}
+ />
+ </Setting>
+ )}
+ />
+ <FormField
+ control={form.control}
+ name="hideScores"
+ render={({ field }) => (
+ <Setting>
+ <VoteIcon className="size-5 shrink-0 translate-y-0.5" />
+ <SettingContent>
+ <SettingTitle htmlFor={field.name} pro>
+ <Trans
+ i18nKey="hideScoresLabel"
+ defaults="Hide scores until after a participant has voted"
+ />
+ </SettingTitle>
+ </SettingContent>
+ <Switch
+ id={field.name}
+ checked={!!field.value}
+ onCheckedChange={(checked) => {
+ if (isFree) {
+ showPayWall();
+ posthog?.capture("trigger paywall", {
+ setting: "hide-scores",
+ from: "poll-settings",
+ });
+ } else {
+ field.onChange(checked);
+ }
+ }}
+ />
+ </Setting>
+ )}
+ />
+ </div>
+ </CardContent>
+ {children}
+ </Card>
);
};
diff --git a/apps/web/src/components/pay-wall-dialog.tsx b/apps/web/src/components/pay-wall-dialog.tsx
deleted file mode 100644
index 1f57fccc5..000000000
--- a/apps/web/src/components/pay-wall-dialog.tsx
+++ /dev/null
@@ -1,189 +0,0 @@
-"use client";
-
-import { pricingData } from "@rallly/billing/pricing";
-import { Badge } from "@rallly/ui/badge";
-import type { DialogProps } from "@rallly/ui/dialog";
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogTitle,
- useDialog,
-} from "@rallly/ui/dialog";
-import { RadioGroup, RadioGroupItem } from "@rallly/ui/radio-group";
-import { CheckIcon, SparklesIcon } from "lucide-react";
-import * as m from "motion/react-m";
-import Link from "next/link";
-import React from "react";
-
-import { Trans } from "@/components/trans";
-import { UpgradeButton } from "@/components/upgrade-button";
-
-const annualSavingsPercentage = (
- ((pricingData.monthly.amount * 12 - pricingData.yearly.amount) /
- (pricingData.monthly.amount * 12)) *
- 100
-).toFixed(0);
-
-const yearlyPrice = (pricingData.yearly.amount / 100).toFixed(2);
-const monthlyPrice = (pricingData.monthly.amount / 100).toFixed(2);
-const monthlyPriceAnnualRate = (pricingData.yearly.amount / 100 / 12).toFixed(
- 2,
-);
-
-export function PayWallDialog({ children, ...forwardedProps }: DialogProps) {
- const dialog = useDialog();
- const [period, setPeriod] = React.useState("monthly");
-
- return (
- <Dialog {...dialog.dialogProps} {...forwardedProps}>
- {children}
- <DialogContent className="w-full max-w-[600px] overflow-hidden bg-gray-50 p-4 sm:p-6">
- <SparklesIcon className="-top-4 absolute left-4 size-32 text-gray-500/10" />
- <div className="space-y-6">
- <header>
- <div className="flex justify-center">
- <div className="inline-flex size-14 items-center justify-center">
- <m.div
- transition={{
- delay: 0.2,
- duration: 0.4,
- type: "spring",
- bounce: 0.5,
- }}
- initial={{ opacity: 0, y: -50 }}
- animate={{ opacity: 1, y: 0 }}
- className="text-center"
- aria-hidden="true"
- >
- <Badge size="lg" variant="secondary">
- <Trans i18nKey="planPro" />
- </Badge>
- </m.div>
- </div>
- </div>
- <DialogTitle className="mt-2 mb-1 text-center font-bold text-xl">
- <Trans defaults="Upgrade to Pro" i18nKey="upgradePromptTitle" />
- </DialogTitle>
- <DialogDescription className="mb-4 text-center text-muted-foreground text-sm leading-relaxed">
- <Trans
- i18nKey="upgradeOverlaySubtitle3"
- defaults="Unlock these feature by upgrading to a Pro plan."
- />
- </DialogDescription>
- </header>
- <section>
- <ul className="grid justify-center gap-2 text-center font-medium text-sm sm:grid-cols-2">
- <li>
- <CheckIcon className="mr-2 inline-block size-4 text-green-600" />
- <Trans i18nKey="featureNameFinalize" defaults="Finalize Poll" />
- </li>
- <li>
- <CheckIcon className="mr-2 inline-block size-4 text-green-600" />
- <Trans
- i18nKey="featureNameDuplicate"
- defaults="Duplicate Poll"
- />
- </li>
- <li>
- <CheckIcon className="mr-2 inline-block size-4 text-green-600" />
- <Trans
- i18nKey="featureNameAdvancedSettings"
- defaults="Advanced Settings"
- />
- </li>
- <li>
- <CheckIcon className="mr-2 inline-block size-4 text-green-600" />
- <Trans
- i18nKey="featureNameExtendedPollLifetime"
- defaults="Extended Poll Lifetime"
- />
- </li>
- </ul>
- </section>
- <section>
- <RadioGroup value={period} onValueChange={setPeriod}>
- <li className="relative flex items-center justify-between rounded-lg border bg-gray-50 p-4 focus-within:bg-gray-100 focus-within:ring-gray-300 hover:bg-gray-100">
- <div className="flex items-center gap-4">
- <RadioGroupItem id="monthly" value="monthly" />
- <label className="font-semibold text-base" htmlFor="monthly">
- <span role="presentation" className="absolute inset-0" />
- <Trans defaults="1 month" i18nKey="1month" />
- </label>
- </div>
- <p className="flex items-baseline gap-1">
- <span className="font-semibold text-xl">${monthlyPrice}</span>
- <span className="text-muted-foreground text-sm">/ mo</span>
- </p>
- </li>
- <li className="relative flex items-center justify-between rounded-lg border bg-gray-50 p-4 focus-within:bg-gray-100 focus-within:ring-gray-300 hover:bg-gray-100">
- <div className="space-y-1">
- <div className="flex items-center gap-4">
- <RadioGroupItem id="yearly" value="yearly" />
- <div className="flex items-center gap-2">
- <label
- className="font-semibold text-base"
- htmlFor="yearly"
- >
- <span
- role="presentation"
- className="absolute inset-0"
- />
- <Trans defaults="12 months" i18nKey="12months" />
- </label>
- <Badge variant="secondary">
- <Trans
- defaults="Save {percentage}%"
- i18nKey="savePercentage"
- values={{ percentage: annualSavingsPercentage }}
- />
- </Badge>
- </div>
- </div>
- <p className="pointer-events-none flex items-baseline gap-1.5 pl-8 text-muted-foreground text-sm">
- <span>${yearlyPrice}</span>
- <span className="line-through opacity-50">
- ${((pricingData.monthly.amount * 12) / 100).toFixed(2)}
- </span>
- </p>
- </div>
- <p className="flex items-baseline gap-1">
- <span className="font-semibold text-xl">
- ${monthlyPriceAnnualRate}
- </span>
- <span className="text-muted-foreground text-sm">/ mo</span>
- </p>
- </li>
- </RadioGroup>
- </section>
- <footer className="space-y-4">
- <div className="grid gap-2">
- <UpgradeButton
- className="w-full"
- large
- annual={period === "yearly"}
- >
- <Trans i18nKey="upgrade" defaults="Upgrade" />
- </UpgradeButton>
- </div>
- <p className="text-center text-muted-foreground text-sm">
- <Trans
- i18nKey="cancelAnytime"
- defaults="Cancel anytime from your <a>billing page</a>."
- components={{
- a: (
- <Link
- onClick={() => dialog.dismiss()}
- className="text-link"
- href="/account/billing"
- />
- ),
- }}
- />
- </p>
- </footer>
- </div>
- </DialogContent>
- </Dialog>
- );
-}
diff --git a/apps/web/src/components/poll/manage-poll.tsx b/apps/web/src/components/poll/manage-poll.tsx
index 90ed60421..66a521978 100644
--- a/apps/web/src/components/poll/manage-poll.tsx
+++ b/apps/web/src/components/poll/manage-poll.tsx
@@ -28,14 +28,13 @@ import Link from "next/link";
import * as React from "react";
import { DuplicateDialog } from "@/app/[locale]/(optional-space)/poll/[urlId]/duplicate-dialog";
-import { PayWallDialog } from "@/components/pay-wall-dialog";
import { FinalizePollDialog } from "@/components/poll/manage-poll/finalize-poll-dialog";
import { ProBadge } from "@/components/pro-badge";
import { Trans } from "@/components/trans";
import { usePoll } from "@/contexts/poll";
+import { useBilling } from "@/features/billing/client";
import { useSpace } from "@/features/space/client";
import { trpc } from "@/trpc/client";
-
import { DeletePollDialog } from "./manage-poll/delete-poll-dialog";
import { useCsvExporter } from "./manage-poll/use-csv-exporter";
@@ -143,7 +142,7 @@ const ManagePoll: React.FunctionComponent<{
const [showDeletePollDialog, setShowDeletePollDialog] = React.useState(false);
const duplicateDialog = useDialog();
const finalizeDialog = useDialog();
- const paywallDialog = useDialog();
+ const { showPayWall } = useBilling();
const posthog = usePostHog();
const { exportToCsv } = useCsvExporter();
@@ -203,7 +202,7 @@ const ManagePoll: React.FunctionComponent<{
disabled={!!poll.event}
onClick={() => {
if (space.data.tier !== "pro") {
- paywallDialog.trigger();
+ showPayWall();
posthog?.capture("trigger paywall", {
poll_id: poll.id,
from: "manage-poll",
@@ -232,7 +231,7 @@ const ManagePoll: React.FunctionComponent<{
<DropdownMenuItem
onClick={() => {
if (space.data.tier !== "pro") {
- paywallDialog.trigger();
+ showPayWall();
posthog?.capture("trigger paywall", {
poll_id: poll.id,
action: "duplicate",
@@ -271,7 +270,6 @@ const ManagePoll: React.FunctionComponent<{
{...duplicateDialog.dialogProps}
/>
<FinalizePollDialog {...finalizeDialog.dialogProps} />
- <PayWallDialog {...paywallDialog.dialogProps} />
</>
);
};
diff --git a/apps/web/src/components/pro-badge.tsx b/apps/web/src/components/pro-badge.tsx
index 9e424b8e4..46502d13b 100644
--- a/apps/web/src/components/pro-badge.tsx
+++ b/apps/web/src/components/pro-badge.tsx
@@ -1,11 +1,11 @@
import { Badge } from "@rallly/ui/badge";
-import { Trans } from "@/components/trans";
+import { PLAN_NAMES } from "@/features/billing/constants";
export const ProBadge = ({ className }: { className?: string }) => {
return (
<Badge variant="secondary" className={className}>
- <Trans i18nKey="planPro" />
+ {PLAN_NAMES.PRO}
</Badge>
);
};
diff --git a/apps/web/src/components/upgrade-button.tsx b/apps/web/src/components/upgrade-button.tsx
index 679b69d78..8f1b376d8 100644
--- a/apps/web/src/components/upgrade-button.tsx
+++ b/apps/web/src/components/upgrade-button.tsx
@@ -8,11 +8,9 @@ import { Trans } from "@/components/trans";
export const UpgradeButton = ({
children,
annual,
- large,
className,
}: React.PropsWithChildren<{
annual?: boolean;
- large?: boolean;
className?: string;
}>) => {
const posthog = usePostHog();
@@ -31,7 +29,7 @@ export const UpgradeButton = ({
value={window.location.pathname}
/>
<Button
- size={large ? "lg" : "default"}
+ size="md"
className={className}
variant="primary"
onClick={(e) => {
diff --git a/apps/web/src/features/billing/client.tsx b/apps/web/src/features/billing/client.tsx
new file mode 100644
index 000000000..36794f1f5
--- /dev/null
+++ b/apps/web/src/features/billing/client.tsx
@@ -0,0 +1,63 @@
+"use client";
+
+import type { ButtonProps } from "@rallly/ui/button";
+import { Button } from "@rallly/ui/button";
+import React from "react";
+import { PayWallDialog } from "./components/pay-wall-dialog";
+
+interface BillingContextType {
+ showPayWall: () => void;
+}
+
+const BillingContext = React.createContext<BillingContextType | null>(null);
+
+interface BillingProviderProps {
+ children: React.ReactNode;
+}
+
+export function BillingProvider({ children }: BillingProviderProps) {
+ const [isPayWallOpen, setIsPayWallOpen] = React.useState(false);
+
+ const showPayWall = React.useCallback(() => {
+ setIsPayWallOpen(true);
+ }, []);
+
+ const handlePayWallClose = React.useCallback(() => {
+ setIsPayWallOpen(false);
+ }, []);
+
+ const contextValue = React.useMemo(
+ () => ({
+ showPayWall,
+ }),
+ [showPayWall],
+ );
+
+ return (
+ <BillingContext.Provider value={contextValue}>
+ {children}
+ <PayWallDialog isOpen={isPayWallOpen} onClose={handlePayWallClose} />
+ </BillingContext.Provider>
+ );
+}
+
+export function useBilling() {
+ const context = React.useContext(BillingContext);
+ if (!context) {
+ throw new Error("useBilling must be used within a BillingProvider");
+ }
+ return context;
+}
+
+export const PayWallButton = ({ onClick, ...forwardedProps }: ButtonProps) => {
+ const { showPayWall } = useBilling();
+ return (
+ <Button
+ onClick={(e) => {
+ showPayWall();
+ onClick?.(e);
+ }}
+ {...forwardedProps}
+ />
+ );
+};
diff --git a/apps/web/src/features/billing/components/pay-wall-dialog.tsx b/apps/web/src/features/billing/components/pay-wall-dialog.tsx
new file mode 100644
index 000000000..b920ef175
--- /dev/null
+++ b/apps/web/src/features/billing/components/pay-wall-dialog.tsx
@@ -0,0 +1,421 @@
+"use client";
+
+import { pricingData } from "@rallly/billing/pricing";
+import { Button } from "@rallly/ui/button";
+import {
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogHeader,
+ DialogTitle,
+} from "@rallly/ui/dialog";
+import { Icon } from "@rallly/ui/icon";
+import { Label } from "@rallly/ui/label";
+import { RadioGroup, RadioGroupItem } from "@rallly/ui/radio-group";
+import { Switch } from "@rallly/ui/switch";
+import { Tabs, TabsContent } from "@rallly/ui/tabs";
+import {
+ CalendarCheckIcon,
+ CalendarSearchIcon,
+ CheckIcon,
+ ClockIcon,
+ CopyIcon,
+ LifeBuoyIcon,
+ SettingsIcon,
+ TimerResetIcon,
+ UserPlusIcon,
+} from "lucide-react";
+import Link from "next/link";
+import React from "react";
+import { Trans } from "@/components/trans";
+import { UpgradeButton } from "@/components/upgrade-button";
+import type { SpaceTier } from "@/features/space/schema";
+import { spaceTierSchema } from "@/features/space/schema";
+import { PLAN_NAMES } from "../constants";
+
+function KeyBenefits({ children }: { children?: React.ReactNode }) {
+ return <ul className="space-y-3">{children}</ul>;
+}
+
+function KeyBenefitsItem({
+ icon,
+ title,
+ description,
+}: {
+ icon?: React.ReactNode;
+ title: React.ReactNode;
+ description?: React.ReactNode;
+}) {
+ return (
+ <li className="flex items-center gap-3">
+ <div className="rounded-lg border bg-gradient-to-b from-white to-gray-50 p-2">
+ <Icon>{icon}</Icon>
+ </div>
+ <div>
+ <div className="mt-2 font-medium text-sm">{title}</div>
+ <div className="mt-1 text-muted-foreground text-xs">{description}</div>
+ </div>
+ </li>
+ );
+}
+
+function SubHeading({ children }: { children?: React.ReactNode }) {
+ return (
+ <h3 className="font-medium text-muted-foreground text-xs uppercase">
+ {children}
+ </h3>
+ );
+}
+
+function PlanRadioGroup({
+ value,
+ onValueChange,
+ children,
+}: {
+ value: string;
+ onValueChange: (value: string) => void;
+ children: React.ReactNode;
+}) {
+ return (
+ <RadioGroup value={value} onValueChange={onValueChange}>
+ {children}
+ </RadioGroup>
+ );
+}
+
+function PlanRadioGroupItem({
+ value,
+ id,
+ title,
+ price,
+ priceLabel,
+}: {
+ value: string;
+ id: string;
+ title: React.ReactNode;
+ price: React.ReactNode;
+ priceLabel?: React.ReactNode;
+}) {
+ return (
+ <label
+ htmlFor={id}
+ className="flex cursor-pointer items-center justify-between gap-4 rounded-lg border p-4 transition-colors has-[[data-state=checked]]:border-primary-600 has-[[data-state=checked]]:ring-1 has-[[data-state=checked]]:ring-primary"
+ >
+ <RadioGroupItem value={value} id={id} />
+ <div className="flex-1">
+ <h3 className="font-medium text-sm">{title}</h3>
+ </div>
+ <div className="flex items-baseline gap-1">
+ <p className="font-medium text-sm">{price}</p>
+ {priceLabel && (
+ <p className="text-muted-foreground text-xs">{priceLabel}</p>
+ )}
+ </div>
+ </label>
+ );
+}
+
+const currencyFormatter = new Intl.NumberFormat("en-US", {
+ style: "currency",
+ currency: "USD",
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2,
+});
+
+interface PayWallDialogProps {
+ isOpen: boolean;
+ onClose: () => void;
+}
+
+export function PayWallDialog({ isOpen, onClose }: PayWallDialogProps) {
+ const [selectedPlan, setSelectedPlan] = React.useState<SpaceTier>("pro");
+ const [isAnnual, setIsAnnual] = React.useState(false);
+
+ const handleChangePlan = (value: string) => {
+ setSelectedPlan(spaceTierSchema.parse(value));
+ };
+
+ const getProPrice = () => {
+ if (isAnnual) {
+ const yearlyPrice = pricingData.yearly.amount / 100;
+ const monthlyEquivalent = yearlyPrice / 12;
+ return currencyFormatter.format(monthlyEquivalent);
+ } else {
+ const monthlyPrice = pricingData.monthly.amount / 100;
+ return currencyFormatter.format(monthlyPrice);
+ }
+ };
+
+ return (
+ <Dialog open={isOpen} onOpenChange={onClose}>
+ <DialogContent size="4xl" className="overflow-hidden p-0 lg:h-[500px]">
+ <Tabs value={selectedPlan} onValueChange={handleChangePlan} asChild>
+ <div className="grid min-h-0 grid-cols-1 md:grid-cols-2">
+ <div className="flex flex-col p-6">
+ <DialogHeader>
+ <DialogTitle>
+ <Trans i18nKey="upgradePromptTitle" />
+ </DialogTitle>
+ </DialogHeader>
+ <div className="mt-6 flex-1 space-y-6">
+ <ul className="space-y-2 text-muted-foreground">
+ <li className="text-sm">
+ <CheckIcon className="mr-2 inline-block size-4" />
+ <Trans
+ i18nKey="cancelAnytime"
+ components={{
+ a: (
+ <Link
+ className="underline"
+ href="/settings/billing"
+ />
+ ),
+ }}
+ />
+ </li>
+ <li className="text-sm">
+ <CheckIcon className="mr-2 inline-block size-4" />
+ <Trans
+ i18nKey="instantAccess"
+ defaults="Instant access to all features"
+ />
+ </li>
+ </ul>
+ <hr className="border-gray-100" />
+ <Label>
+ <Trans i18nKey="selectPlan" defaults="Select Plan:" />
+ </Label>
+ <PlanRadioGroup
+ value={selectedPlan}
+ onValueChange={handleChangePlan}
+ >
+ <PlanRadioGroupItem
+ value="hobby"
+ id="hobby"
+ title={PLAN_NAMES.HOBBY}
+ price={<Trans i18nKey="planFree" defaults="Free" />}
+ />
+ <PlanRadioGroupItem
+ value="pro"
+ id="pro"
+ title={PLAN_NAMES.PRO}
+ price={getProPrice()}
+ priceLabel={
+ <Trans i18nKey="perSeatMonth" defaults="/seat/mo" />
+ }
+ />
+ </PlanRadioGroup>
+ </div>
+
+ <div className="space-y-4 pt-4">
+ {selectedPlan === "pro" && (
+ <div className="flex justify-between gap-4 rounded-lg border border-dashed bg-muted-background p-4">
+ <div className="space-y-2">
+ <Label htmlFor="annual-switch">
+ <Trans
+ defaults="Save {amount} with yearly billing"
+ i18nKey="annualSavings"
+ values={{
+ amount: currencyFormatter.format(
+ (pricingData.monthly.amount * 12 -
+ pricingData.yearly.amount) /
+ 100,
+ ),
+ }}
+ />
+ </Label>
+ <p className="text-muted-foreground text-sm">
+ <Trans
+ defaults="Pay for {payMonths, number} months, get 12."
+ i18nKey="annualDiscount"
+ values={{
+ payMonths: 8,
+ }}
+ />
+ </p>
+ </div>
+ <Switch
+ checked={isAnnual}
+ onCheckedChange={setIsAnnual}
+ id="annual-switch"
+ />
+ </div>
+ )}
+ <TabsContent value="pro">
+ <UpgradeButton className="w-full" annual={isAnnual}>
+ <Trans i18nKey="upgrade" defaults="Upgrade" />
+ </UpgradeButton>
+ </TabsContent>
+ <TabsContent value="hobby">
+ <DialogClose asChild>
+ <Button size="md" disabled={true} className="w-full">
+ <Trans i18nKey="currentPlan" defaults="Current Plan" />
+ </Button>
+ </DialogClose>
+ </TabsContent>
+ </div>
+ </div>
+
+ {/* Right Side - Plan Benefits */}
+ <div className="hidden overflow-y-auto bg-muted-background px-6 py-6 md:block">
+ <TabsContent value="hobby" className="space-y-6">
+ <DialogHeader>
+ <DialogTitle>{PLAN_NAMES.HOBBY}</DialogTitle>
+ <DialogDescription>
+ <Trans
+ i18nKey="planHobbyDescription"
+ defaults="For casual users"
+ />
+ </DialogDescription>
+ </DialogHeader>
+ <div className="space-y-3">
+ <SubHeading>
+ <Trans i18nKey="keyBenefits" defaults="Key Benefits" />
+ </SubHeading>
+ <KeyBenefits>
+ <KeyBenefitsItem
+ icon={<CalendarSearchIcon />}
+ title={
+ <Trans i18nKey="basicPolls" defaults="Basic polls" />
+ }
+ description={
+ <Trans
+ i18nKey="basicPollsDescription"
+ defaults="Create simple scheduling polls"
+ />
+ }
+ />
+ <KeyBenefitsItem
+ icon={<TimerResetIcon />}
+ title={
+ <Trans
+ i18nKey="limitedPollLifetime"
+ defaults="Limited Poll Lifetime"
+ />
+ }
+ description={
+ <Trans
+ i18nKey="limitedPollLifetimeDescription"
+ defaults="Inactive polls are automatically deleted"
+ />
+ }
+ />
+ </KeyBenefits>
+ </div>
+ </TabsContent>
+ <TabsContent value="pro" className="space-y-6">
+ <DialogHeader>
+ <DialogTitle>{PLAN_NAMES.PRO}</DialogTitle>
+ <DialogDescription>
+ <Trans
+ i18nKey="planProDescription"
+ defaults="For professionals and power users"
+ />
+ </DialogDescription>
+ </DialogHeader>
+ <div className="space-y-3">
+ <SubHeading>
+ <Trans i18nKey="keyBenefits" defaults="Key Benefits" />
+ </SubHeading>
+ <KeyBenefits>
+ <KeyBenefitsItem
+ icon={<CalendarCheckIcon />}
+ title={
+ <Trans
+ i18nKey="featureNameFinalize"
+ defaults="Finalize Poll"
+ />
+ }
+ description={
+ <Trans
+ i18nKey="finalizePollDescription"
+ defaults="Lock in the final meeting time and notify participants"
+ />
+ }
+ />
+ <KeyBenefitsItem
+ icon={<CopyIcon />}
+ title={
+ <Trans
+ i18nKey="featureNameDuplicate"
+ defaults="Duplicate Poll"
+ />
+ }
+ description={
+ <Trans
+ i18nKey="duplicatePollDescription"
+ defaults="Quickly create similar polls from existing ones"
+ />
+ }
+ />
+ <KeyBenefitsItem
+ icon={<SettingsIcon />}
+ title={
+ <Trans
+ i18nKey="featureNameAdvancedSettings"
+ defaults="Advanced Settings"
+ />
+ }
+ description={
+ <Trans
+ i18nKey="advancedSettingsDescription"
+ defaults="Customize poll behavior and participant permissions"
+ />
+ }
+ />
+ <KeyBenefitsItem
+ icon={<ClockIcon />}
+ title={
+ <Trans
+ i18nKey="featureNameExtendedPollLifetime"
+ defaults="Extended Poll Lifetime"
+ />
+ }
+ description={
+ <Trans
+ i18nKey="extendedPollLifetimeDescription"
+ defaults="Keep polls indefinitely"
+ />
+ }
+ />
+ <KeyBenefitsItem
+ icon={<UserPlusIcon />}
+ title={
+ <Trans
+ i18nKey="teamCollaboration"
+ defaults="Team collaboration"
+ />
+ }
+ description={
+ <Trans
+ i18nKey="teamCollaborationDescription"
+ defaults="Invite team members with centralized billing"
+ />
+ }
+ />
+ <KeyBenefitsItem
+ icon={<LifeBuoyIcon />}
+ title={
+ <Trans
+ i18nKey="prioritySupport"
+ defaults="Priority support"
+ />
+ }
+ description={
+ <Trans
+ i18nKey="prioritySupportDescription"
+ defaults="Get faster response times and dedicated assistance"
+ />
+ }
+ />
+ </KeyBenefits>
+ </div>
+ </TabsContent>
+ </div>
+ </div>
+ </Tabs>
+ </DialogContent>
+ </Dialog>
+ );
+}
diff --git a/apps/web/src/features/billing/constants.ts b/apps/web/src/features/billing/constants.ts
index 697ee3c0b..36a186b8c 100644
--- a/apps/web/src/features/billing/constants.ts
+++ b/apps/web/src/features/billing/constants.ts
@@ -1,3 +1,6 @@
import { isSelfHosted } from "@/utils/constants";
export const isBillingEnabled = !isSelfHosted;
+
+// Re-export plan names from the shared billing package
+export { PLAN_NAMES } from "@rallly/billing";
diff --git a/apps/web/src/features/space/components/space-tier.tsx b/apps/web/src/features/space/components/space-tier.tsx
index 7f99e1e76..e4530d48b 100644
--- a/apps/web/src/features/space/components/space-tier.tsx
+++ b/apps/web/src/features/space/components/space-tier.tsx
@@ -1,15 +1,15 @@
"use client";
import { HandHeartIcon, SparklesIcon } from "lucide-react";
-import { Trans } from "@/components/trans";
+import { PLAN_NAMES } from "@/features/billing/constants";
import type { SpaceTier } from "@/features/space/schema";
export const SpaceTierLabel = ({ tier }: { tier: SpaceTier }) => {
switch (tier) {
case "hobby":
- return <Trans i18nKey="planHobby" defaults="Hobby" />;
+ return PLAN_NAMES.HOBBY;
case "pro":
- return <Trans i18nKey="planPro" defaults="Pro" />;
+ return PLAN_NAMES.PRO;
}
};
diff --git a/packages/billing/src/index.ts b/packages/billing/src/index.ts
index 63fc923c0..a727c0d80 100644
--- a/packages/billing/src/index.ts
+++ b/packages/billing/src/index.ts
@@ -1 +1,7 @@
export * from "./lib/stripe";
+export * from "./pricing";
+
+export const PLAN_NAMES = {
+ HOBBY: "Hobby",
+ PRO: "Pro",
+} as const;