diff --git a/packages/web/app/pages/[orgId]/subscription/manage.tsx b/packages/web/app/pages/[orgId]/subscription/manage.tsx index 2c44c1fd1..f1b1d86e9 100644 --- a/packages/web/app/pages/[orgId]/subscription/manage.tsx +++ b/packages/web/app/pages/[orgId]/subscription/manage.tsx @@ -195,14 +195,12 @@ const Inner = ({
Choose Your Plan -
- -
+
Plan Summary diff --git a/packages/web/app/src/components/organization/billing/BillingPlanPicker.tsx b/packages/web/app/src/components/organization/billing/BillingPlanPicker.tsx index 64f4bc81b..25fc6dc11 100644 --- a/packages/web/app/src/components/organization/billing/BillingPlanPicker.tsx +++ b/packages/web/app/src/components/organization/billing/BillingPlanPicker.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { ReactNode, ReactElement } from 'react'; import { List, ListIcon, ListItem } from '@chakra-ui/react'; import { VscCheck } from 'react-icons/vsc'; import { BillingPlanType, BillingPlansQuery } from '@/graphql'; @@ -10,8 +10,8 @@ const comingSoon = (coming soon); const planCollection: { [key in BillingPlanType]: { description: string; - features: Array; - footer?: React.ReactNode; + features: Array; + footer?: ReactNode; }; } = { [BillingPlanType.Hobby]: { @@ -59,7 +59,7 @@ const planCollection: { '360 days of usage data retention',
Schema Policy Checks {comingSoon}
,
ESLint integration {comingSoon}
, - 'SAML (coming soon)', +
SAML {comingSoon}
, Support from @@ -67,18 +67,18 @@ const planCollection: { , ], - footer: <>Shape a custom plan for your business, + footer: 'Shape a custom plan for your business', }, }; -const Plan: React.FC<{ +const Plan = (plan: { isActive: boolean; name: string; price: string | number; description: string; - features: React.ReactNode[]; - footer?: React.ReactNode; -}> = plan => { + features: ReactNode[]; + footer?: ReactNode; +}): ReactElement => { return (
@@ -100,16 +100,14 @@ const Plan: React.FC<{
{plan.description}
- {plan.features.map((feature, i) => { - return ( - - - - {feature} - - - ); - })} + {plan.features.map((feature, i) => ( + + + + {feature} + + + ))}
@@ -123,43 +121,37 @@ const Plan: React.FC<{ ); }; -export const BillingPlanPicker: React.FC<{ +export const BillingPlanPicker = ({ + value, + activePlan, + plans, + onPlanChange, +}: { value: BillingPlanType; activePlan: BillingPlanType; plans: BillingPlansQuery['billingPlans']; onPlanChange: (plan: BillingPlanType) => void; -}> = ({ value, activePlan, plans, onPlanChange }) => { +}): ReactElement => { return ( - - {plans.map(plan => { - return ( - + {plans.map(plan => ( + + - - - ); - })} + name={plan.name} + price={ + { + [BillingPlanType.Hobby]: 'Free', + [BillingPlanType.Enterprise]: 'Contact Us', + }[plan.planType] || plan.basePrice + } + isActive={activePlan === plan.planType} + features={planCollection[plan.planType].features} + description={planCollection[plan.planType].description} + footer={planCollection[plan.planType].footer} + /> + + ))} ); };