Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(frontend): move billing toggle closer to plan cards in onboarding (#14673)

Ubbe70930fd09c7f
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/SubscriptionStep.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/SubscriptionStep.tsx
index e0cc16001a..8680bbac4c 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/SubscriptionStep.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/SubscriptionStep.tsx
@@ -48,60 +48,62 @@ export function SubscriptionStep() {
<div className="w-full max-w-3xl">
<TrialCard returnTo="onboarding" />
</div>
- <div className="inline-flex rounded-full border border-[#d8d8d8] bg-zinc-100 p-[3px]">
- {(["monthly", "yearly"] as const).map((cycle) => (
- <button
- key={cycle}
- type="button"
- onClick={() => setBilling(cycle)}
- // Read by DataFast's script directly (delegated click listener on
- // document), the same way the marketing site tags its CTAs — no
- // JS needed. The `-cycle` suffix becomes the `cycle` metadata key.
- data-fast-goal="paywall_billing_toggle"
- data-fast-goal-cycle={cycle}
- data-fast-goal-surface="onboarding_paywall"
- className={cn(
- "rounded-full border-none px-4 py-1.5 text-xs font-medium transition-all",
- billing === cycle
- ? "bg-white text-zinc-900 shadow-sm"
- : "bg-transparent text-zinc-500 hover:text-zinc-700",
- )}
- >
- {cycle === "monthly" ? (
- "Monthly billing"
- ) : (
- <>
- Yearly billing{" "}
- <span className="ml-1.5 bg-gradient-to-r from-green-500 via-emerald-500 to-teal-500 bg-clip-text text-[11px] font-semibold text-transparent">
- Save 15%
- </span>
- </>
- )}
- </button>
- ))}
- </div>
-
- <div className="relative mt-2 w-full max-w-[75.625rem]">
- <div className="grid w-full grid-cols-1 gap-4 px-[1rem] md:grid-cols-3 md:px-0">
- {plans.map((plan) => (
- <PlanCard
- key={plan.key}
- plan={plan}
- country={country}
- isYearly={isYearly}
- onSelect={handlePlanSelect}
- loading={isUpdatingTier && selectedPlan === plan.key}
- disabled={isUpdatingTier && selectedPlan !== plan.key}
- priceCaption="billing-period"
- ctaGoalSurface="onboarding_paywall"
+ <div className="mt-6 flex w-full flex-col items-center gap-3">
+ <div className="inline-flex rounded-full border border-[#d8d8d8] bg-zinc-100 p-[3px]">
+ {(["monthly", "yearly"] as const).map((cycle) => (
+ <button
+ key={cycle}
+ type="button"
+ onClick={() => setBilling(cycle)}
+ // Read by DataFast's script directly (delegated click listener on
+ // document), the same way the marketing site tags its CTAs — no
+ // JS needed. The `-cycle` suffix becomes the `cycle` metadata key.
+ data-fast-goal="paywall_billing_toggle"
+ data-fast-goal-cycle={cycle}
+ data-fast-goal-surface="onboarding_paywall"
className={cn(
- plan.key === PLAN_KEYS.MAX && "order-1 md:order-none",
- plan.key === PLAN_KEYS.PRO && "order-2 md:order-none",
- plan.key === PLAN_KEYS.TEAM && "order-3 md:order-none",
+ "rounded-full border-none px-4 py-1.5 text-xs font-medium transition-all",
+ billing === cycle
+ ? "bg-white text-zinc-900 shadow-sm"
+ : "bg-transparent text-zinc-500 hover:text-zinc-700",
+ )}
+ >
+ {cycle === "monthly" ? (
+ "Monthly billing"
+ ) : (
+ <>
+ Yearly billing{" "}
+ <span className="ml-1.5 bg-gradient-to-r from-green-500 via-emerald-500 to-teal-500 bg-clip-text text-[11px] font-semibold text-transparent">
+ Save 15%
+ </span>
+ </>
)}
- />
+ </button>
))}
</div>
+
+ <div className="relative w-full max-w-[75.625rem]">
+ <div className="grid w-full grid-cols-1 gap-4 px-[1rem] md:grid-cols-3 md:px-0">
+ {plans.map((plan) => (
+ <PlanCard
+ key={plan.key}
+ plan={plan}
+ country={country}
+ isYearly={isYearly}
+ onSelect={handlePlanSelect}
+ loading={isUpdatingTier && selectedPlan === plan.key}
+ disabled={isUpdatingTier && selectedPlan !== plan.key}
+ priceCaption="billing-period"
+ ctaGoalSurface="onboarding_paywall"
+ className={cn(
+ plan.key === PLAN_KEYS.MAX && "order-1 md:order-none",
+ plan.key === PLAN_KEYS.PRO && "order-2 md:order-none",
+ plan.key === PLAN_KEYS.TEAM && "order-3 md:order-none",
+ )}
+ />
+ ))}
+ </div>
+ </div>
</div>
<Text variant="body" className="!text-zinc-500">
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/helpers.ts b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/helpers.ts
index 4b394e912c..7ed9a083c3 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/helpers.ts
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/SubscriptionStep/helpers.ts
@@ -90,7 +90,6 @@ export function getSubscriptionPricingExperimentPlans(
...plan,
highlighted,
badge: highlighted ? HIGHLIGHT_BADGE : null,
- buttonVariant: highlighted ? "primary" : "secondary",
} satisfies PlanDef;
});
}
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/SubscriptionStep.test.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/SubscriptionStep.test.tsx
index 75e944d18c..b60c9a065c 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/SubscriptionStep.test.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/onboarding/steps/__tests__/SubscriptionStep.test.tsx
@@ -96,12 +96,12 @@ describe("subscription pricing experiment helpers", () => {
expect(pro).toMatchObject({
highlighted: false,
badge: null,
- buttonVariant: "secondary",
+ buttonVariant: "primary",
});
expect(max).toMatchObject({
highlighted: false,
badge: null,
- buttonVariant: "secondary",
+ buttonVariant: "primary",
});
});
@@ -133,7 +133,7 @@ describe("subscription pricing experiment helpers", () => {
expect(max).toMatchObject({
highlighted: false,
badge: null,
- buttonVariant: "secondary",
+ buttonVariant: "primary",
});
});
});
diff --git a/autogpt_platform/frontend/src/components/molecules/PlanCard/PlanCard.tsx b/autogpt_platform/frontend/src/components/molecules/PlanCard/PlanCard.tsx
index f65f42cde7..0daca59697 100644
--- a/autogpt_platform/frontend/src/components/molecules/PlanCard/PlanCard.tsx
+++ b/autogpt_platform/frontend/src/components/molecules/PlanCard/PlanCard.tsx
@@ -255,7 +255,6 @@ export function PlanCard({
)}
<Button
variant={plan.buttonVariant}
- size={hl ? "large" : "small"}
onClick={() => onSelect(plan.key)}
className="w-full"
loading={loading}
diff --git a/autogpt_platform/frontend/src/components/molecules/PlanCard/plans.ts b/autogpt_platform/frontend/src/components/molecules/PlanCard/plans.ts
index 26ac98488b..aa927277b3 100644
--- a/autogpt_platform/frontend/src/components/molecules/PlanCard/plans.ts
+++ b/autogpt_platform/frontend/src/components/molecules/PlanCard/plans.ts
@@ -48,7 +48,7 @@ export const PLANS: PlanDef[] = [
cta: "Get Pro",
highlighted: false,
badge: null,
- buttonVariant: "secondary",
+ buttonVariant: "primary",
},
{
key: PLAN_KEYS.MAX,
@@ -118,7 +118,7 @@ export const PLAN_METADATA: Record<
cta: "Upgrade to Pro",
highlighted: false,
badge: null,
- buttonVariant: "secondary",
+ buttonVariant: "primary",
},
MAX: {
key: PLAN_KEYS.MAX,
@@ -137,7 +137,7 @@ export const PLAN_METADATA: Record<
cta: "Upgrade to Max",
highlighted: false,
badge: null,
- buttonVariant: "secondary",
+ buttonVariant: "primary",
},
BUSINESS: {
key: PLAN_KEYS.BUSINESS,