From 08052b13cf7b5df0587b3904eff3126f1be9702c Mon Sep 17 00:00:00 2001 From: Johannes <72809645+jobenjada@users.noreply.github.com> Date: Thu, 20 Jun 2024 07:54:23 +0200 Subject: [PATCH] chore: add launch and pricing ui tweaks (#2782) Co-authored-by: Matti Nannt --- .../billing/components/PricingTable.tsx | 40 +++++++++++-------- packages/ee/billing/lib/constants.ts | 8 ++-- packages/ui/Badge/index.tsx | 14 +++++-- packages/ui/PricingCard/index.tsx | 23 ++++++----- 4 files changed, 52 insertions(+), 33 deletions(-) diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/components/PricingTable.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/components/PricingTable.tsx index 284daf07e6..0cede767c9 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/components/PricingTable.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/components/PricingTable.tsx @@ -10,6 +10,7 @@ import { useEffect, useState } from "react"; import toast from "react-hot-toast"; import { CLOUD_PRICING_DATA } from "@formbricks/ee/billing/lib/constants"; import { cn } from "@formbricks/lib/cn"; +import { capitalizeFirstLetter } from "@formbricks/lib/utils/strings"; import { TOrganization, TOrganizationBillingPeriod } from "@formbricks/types/organizations"; import { Badge } from "@formbricks/ui/Badge"; import { BillingSlider } from "@formbricks/ui/BillingSlider"; @@ -131,8 +132,8 @@ export const PricingTable = ({
-

- Current Plan: {organization.billing.plan} +

+ Current Plan: {capitalizeFirstLetter(organization.billing.plan)} {cancellingOn && ( -
+
-
-
-
handleMonthlyToggle("monthly")}> - Monthly +
+
+
+
handleMonthlyToggle("monthly")}> + Monthly +
+
handleMonthlyToggle("yearly")}> + Yearly +
-
handleMonthlyToggle("yearly")}> - Yearly +
+ 50% off for 6 months with PH50 - 24h only 🔥
diff --git a/packages/ee/billing/lib/constants.ts b/packages/ee/billing/lib/constants.ts index ee7180d5a1..0350b4d145 100644 --- a/packages/ee/billing/lib/constants.ts +++ b/packages/ee/billing/lib/constants.ts @@ -28,13 +28,14 @@ export const CLOUD_PRICING_DATA = { id: "startup", featured: false, description: "Everything in Free with additional features.", - price: { monthly: "€59", yearly: "€49" }, + offer: true, + price: { monthly: "€29", yearly: "€25" }, mainFeatures: [ "Everything in Free", "Remove Branding", + "Email Support", "2.000 Monthly Responses", "2.500 Monthly Identified Users", - "Email Support", ], href: "https://app.formbricks.com/auth/signup?plan=startup", }, @@ -43,7 +44,8 @@ export const CLOUD_PRICING_DATA = { id: "scale", featured: true, description: "Advanced features for scaling your business.", - price: { monthly: "€199", yearly: "€179" }, + offer: true, + price: { monthly: "€99", yearly: "€89" }, mainFeatures: [ "Everything in Startup", "Team Access Roles", diff --git a/packages/ui/Badge/index.tsx b/packages/ui/Badge/index.tsx index 6a85e0a9f7..d352a73564 100644 --- a/packages/ui/Badge/index.tsx +++ b/packages/ui/Badge/index.tsx @@ -21,14 +21,21 @@ export const Badge: React.FC = ({ }) => { const bgColor = { warning: "bg-amber-100", - success: "bg-green-100", + success: "bg-emerald-100", error: "bg-red-100", gray: "bg-slate-100", }; + const borderColor = { + warning: "border-amber-200", + success: "border-emerald-200", + error: "border-red-200", + gray: "border-slate-200", + }; + const textColor = { warning: "text-amber-800", - success: "text-green-800", + success: "text-emerald-800", error: "text-red-800", gray: "text-slate-600", }; @@ -44,8 +51,9 @@ export const Badge: React.FC = ({ return (
- {isCurrentPlan && } - -

- {plan.name} -

+
+

+ {plan.name} +

+ {isCurrentPlan && } +

{planPeriod === "monthly" ? plan.price.monthly : plan.price.yearly}