Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
💄 Rework the pricing billing interval control (#3031)
Luke Vellaa48806a65ee2
diff --git a/apps/landing/src/app/[locale]/(main)/pricing/billing-interval.tsx b/apps/landing/src/app/[locale]/(main)/pricing/billing-interval.tsxindex a7292e1d2..92b3d2074 100644--- a/apps/landing/src/app/[locale]/(main)/pricing/billing-interval.tsx+++ b/apps/landing/src/app/[locale]/(main)/pricing/billing-interval.tsx@@ -50,31 +50,63 @@ export function BillingIntervalSwitch({const { interval, setInterval } = useBillingInterval();const isYearly = interval === "yearly";return (- <div className="flex items-center gap-x-3">- <span- className={cn(- "font-medium text-sm",- isYearly ? "text-gray-500" : "text-gray-800",- )}- >- {monthlyLabel}- </span>- <Switch- aria-label={switchLabel}- checked={isYearly}- onCheckedChange={(checked) =>- setInterval(checked ? "yearly" : "monthly")- }- />- <span- className={cn(- "font-medium text-sm",- isYearly ? "text-gray-800" : "text-gray-500",- )}- >- {yearlyLabel}- </span>- {badge}+ <div className="flex flex-col items-center gap-y-4">+ {badge ? (+ <div className="relative">+ {badge}+ <svg+ aria-hidden="true"+ viewBox="0 0 48 32"+ className="pointer-events-none absolute top-0 -right-16 hidden h-9 w-16 text-gray-400 sm:block"+ fill="none"+ >+ <path+ d="M2 7c17-6 31 1 30 15"+ stroke="currentColor"+ strokeWidth="1.5"+ strokeLinecap="round"+ />+ <path+ d="M26 18l6 5 4-5"+ stroke="currentColor"+ strokeWidth="1.5"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+ </div>+ ) : null}+ <div className="flex items-center gap-x-3">+ <button+ type="button"+ aria-pressed={!isYearly}+ onClick={() => setInterval("monthly")}+ className={cn(+ "cursor-pointer rounded-sm font-medium text-sm transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",+ isYearly ? "text-gray-500" : "text-gray-800",+ )}+ >+ {monthlyLabel}+ </button>+ <Switch+ aria-label={switchLabel}+ checked={isYearly}+ onCheckedChange={(checked) =>+ setInterval(checked ? "yearly" : "monthly")+ }+ />+ <button+ type="button"+ aria-pressed={isYearly}+ onClick={() => setInterval("yearly")}+ className={cn(+ "cursor-pointer rounded-sm font-medium text-sm transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",+ isYearly ? "text-gray-800" : "text-gray-500",+ )}+ >+ {yearlyLabel}+ </button>+ </div></div>);}diff --git a/apps/landing/src/app/[locale]/(main)/pricing/page.tsx b/apps/landing/src/app/[locale]/(main)/pricing/page.tsxindex a3aed481a..198454068 100644--- a/apps/landing/src/app/[locale]/(main)/pricing/page.tsx+++ b/apps/landing/src/app/[locale]/(main)/pricing/page.tsx@@ -140,8 +140,8 @@ export default async function Page(props: {}/></div>- <PlanCards className="mx-auto mt-4 w-full max-w-3xl sm:mt-6">- <PlanCard className="md:col-span-2">+ <PlanCards className="mx-auto mt-4 max-w-6xl sm:mt-6">+ <PlanCard><PlanCardHeader><PlanCardName>{PLAN_NAMES.HOBBY}</PlanCardName><PlanCardDescription>@@ -219,7 +219,7 @@ export default async function Page(props: {</PlanBenefit></PlanBenefits></PlanCard>- <PlanCard className="md:col-span-3">+ <PlanCard><PlanCardHeader><div className="flex items-center justify-between gap-x-4"><PlanCardName>{PLAN_NAMES.PRO}</PlanCardName>diff --git a/apps/landing/src/app/[locale]/(main)/pricing/plan-card.tsx b/apps/landing/src/app/[locale]/(main)/pricing/plan-card.tsxindex 409415cdc..0d8328bc1 100644--- a/apps/landing/src/app/[locale]/(main)/pricing/plan-card.tsx+++ b/apps/landing/src/app/[locale]/(main)/pricing/plan-card.tsx@@ -9,7 +9,7 @@ export function PlanCards({return (<divclassName={cn(- "grid divide-y divide-gray-950/5 overflow-hidden rounded-2xl border bg-white md:grid-cols-5 md:divide-x md:divide-y-0",+ "grid w-fit max-w-full divide-y divide-gray-950/5 overflow-hidden rounded-2xl border bg-white md:grid-cols-[minmax(16rem,2fr)_minmax(24rem,3fr)] md:divide-x md:divide-y-0",className,)}{...props}