From be7f4bc0591706c62fe738f8f7ea331238ab2612 Mon Sep 17 00:00:00 2001 From: Kacper Wojciechowski <39823706+jog1t@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:32:14 +0100 Subject: [PATCH] refactor: change billing plans --- apps/hub/src/components/intro.tsx | 2 +- .../components/billing/billing-plan-card.tsx | 27 +++++-- .../components/billing/billing-plans.tsx | 77 ++++++++++++++----- .../$environmentNameId/builds.tsx | 2 +- 4 files changed, 77 insertions(+), 31 deletions(-) diff --git a/apps/hub/src/components/intro.tsx b/apps/hub/src/components/intro.tsx index 88e2cd13..a71fd479 100644 --- a/apps/hub/src/components/intro.tsx +++ b/apps/hub/src/components/intro.tsx @@ -180,7 +180,7 @@ export function Intro({ initialStep, initialProjectName }: IntroProps) { }} config={{ [RivetEe.ee.billing.Plan.Trial]: { - cancelLabel: "Continue", + cancelLabel: "Get Started", onCancel: () => { navigate({ to: "/projects/$projectNameId/environments/$environmentNameId", diff --git a/apps/hub/src/domains/project/components/billing/billing-plan-card.tsx b/apps/hub/src/domains/project/components/billing/billing-plan-card.tsx index 4f829b71..f02e5e7e 100644 --- a/apps/hub/src/domains/project/components/billing/billing-plan-card.tsx +++ b/apps/hub/src/domains/project/components/billing/billing-plan-card.tsx @@ -7,6 +7,7 @@ import { Flex, SmallText, Text, + cn, } from "@rivet-gg/components"; import { Icon, type IconProp } from "@rivet-gg/icons"; import type { ReactNode } from "@tanstack/react-router"; @@ -16,7 +17,12 @@ export interface BillingPlanCardProps { lead?: string; price: string; priceLead?: string; - features: { key?: string; name: ReactNode; icon?: IconProp }[]; + features: { + key?: string; + name: ReactNode; + icon?: IconProp; + bold?: boolean; + }[]; type?: "custom" | "active"; onSubscribe?: () => void; onCancel?: () => void; @@ -37,13 +43,13 @@ export function BillingPlanCard({ return ( - {title} + {title} {lead ? {lead} : null}

{price} - {type !== "custom" ? "/month" : null} + {type !== "custom" ? "/mo" : null}

{priceLead ? ( @@ -52,13 +58,18 @@ export function BillingPlanCard({
- +
    - {features.map(({ key, name, icon }) => ( + {features.map(({ key, name, bold, icon }) => ( -
  • +
  • {icon ? : null} - {name} + {name}
  • ))} @@ -80,7 +91,7 @@ export function BillingPlanCard({ {cancelLabel || "Cancel"} ) : null} - {!type ? : null} + {!type ? : null} ); diff --git a/apps/hub/src/domains/project/components/billing/billing-plans.tsx b/apps/hub/src/domains/project/components/billing/billing-plans.tsx index 562bdf1b..2833d944 100644 --- a/apps/hub/src/domains/project/components/billing/billing-plans.tsx +++ b/apps/hub/src/domains/project/components/billing/billing-plans.tsx @@ -3,17 +3,18 @@ import { Rivet as RivetEe } from "@rivet-gg/api-ee"; import { Flex, Grid, H2, Link } from "@rivet-gg/components"; import { faBadgeCheck, - faChartMixed, + faCheckCircle, + faClock, faComments, - faComputerClassic, + faDatabase, faEnvelope, faGift, + faGlobe, faHeadset, faInfinity, faLockA, + faRocketLaunch, faServer, - faShareFromSquare, - faShield, } from "@rivet-gg/icons"; import { PRICE_MAP } from "../../data/billing-calculate-usage"; import { useBilling } from "./billing-context"; @@ -67,11 +68,17 @@ export function BillingPlans({ type={plan === RivetEe.ee.billing.Plan.Trial ? "active" : undefined} features={[ { - name: "50,000 Free Actors", + name: ( + + 50,000 Free Actors + + /mo + + + ), + bold: true, icon: faGift, }, - { name: "DDoS Mitigation", icon: faShield }, - { name: "Automatic SSL", icon: faLockA }, { name: "Community Support", icon: faComments }, ]} {...config?.[RivetEe.ee.billing.Plan.Trial]} @@ -93,12 +100,20 @@ export function BillingPlans({ priceLead="+ Actor Usage" features={[ { - name: "200,000 Free Actors", + name: ( + + 200,000 Free Actors + + /mo + + + ), + bold: true, icon: faGift, }, - { name: "Analytics", icon: faChartMixed }, + { name: "Everything in Community", icon: faCheckCircle }, + { name: "No Usage Limits", icon: faInfinity }, { name: "Email Support", icon: faEnvelope }, - { name: "Share Features", icon: faShareFromSquare }, ]} {...config?.[RivetEe.ee.billing.Plan.Indie]} /> @@ -119,12 +134,25 @@ export function BillingPlans({ priceLead="+ Actor Usage" features={[ { - name: "AWS + G Cloud + Azure", - icon: faServer, + name: ( + + 200,000 Free Actors + + /mo + + + ), + bold: true, + icon: faGift, }, - { name: "Analytics", icon: faChartMixed }, + { name: "Everything in Pro", icon: faCheckCircle }, + { name: "No Usage Limits", icon: faInfinity }, { name: "Advanced Support", icon: faHeadset }, - { name: "Share Features", icon: faShareFromSquare }, + { + name: "Dedicated Hardware", + icon: faServer, + }, + { name: "Custom Regions", icon: faGlobe }, ]} {...config?.[RivetEe.ee.billing.Plan.Studio]} /> @@ -132,25 +160,32 @@ export function BillingPlans({ title="Enterprise" price="Custom" features={[ - { - name: "Unlimited Projects", - icon: faInfinity, - }, + { name: "Everything in Team", icon: faCheckCircle }, { name: "Priority Support", icon: faHeadset, }, { - name: "99.99% SLA", + name: "SLA", icon: faBadgeCheck, }, + { name: "No Usage Limits", icon: faInfinity }, { name: "OIDC SSO Provider", icon: faLockA, }, { - name: "Dedicated Hardware", - icon: faComputerClassic, + name: "On-Perm Deployment", + icon: faRocketLaunch, + }, + { + name: "Custom Storage Reads, Writes and Stored Data", + icon: faDatabase, + }, + + { + name: "Custom Log Retention", + icon: faClock, }, ]} type="custom" diff --git a/apps/hub/src/routes/_authenticated/_layout/projects/$projectNameId/environments/$environmentNameId/builds.tsx b/apps/hub/src/routes/_authenticated/_layout/projects/$projectNameId/environments/$environmentNameId/builds.tsx index f1f4b76d..945a2675 100644 --- a/apps/hub/src/routes/_authenticated/_layout/projects/$projectNameId/environments/$environmentNameId/builds.tsx +++ b/apps/hub/src/routes/_authenticated/_layout/projects/$projectNameId/environments/$environmentNameId/builds.tsx @@ -172,7 +172,7 @@ function ProjectBuildLatestButton({ ); } - return ; + return ; } export const Route = createFileRoute(