From 333b6f5a4bb3cad8cb712025442fb1ecbde53088 Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Sun, 28 Jul 2024 20:52:53 +0200 Subject: [PATCH] feat: change subscription plan --- .../SetupSubscription/SubscriptionPlans.tsx | 15 +++++-- .../ChangeSubscriptionPlanDrawer.tsx | 39 +++++++++++++++++++ .../ChangeSubscriptionPlanDrawer/index.ts | 1 + 3 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 packages/webapp/src/containers/Subscriptions/drawers/ChangeSubscriptionPlanDrawer/ChangeSubscriptionPlanDrawer.tsx create mode 100644 packages/webapp/src/containers/Subscriptions/drawers/ChangeSubscriptionPlanDrawer/index.ts diff --git a/packages/webapp/src/containers/Setup/SetupSubscription/SubscriptionPlans.tsx b/packages/webapp/src/containers/Setup/SetupSubscription/SubscriptionPlans.tsx index 7fa489f0e..9b71ab9ce 100644 --- a/packages/webapp/src/containers/Setup/SetupSubscription/SubscriptionPlans.tsx +++ b/packages/webapp/src/containers/Setup/SetupSubscription/SubscriptionPlans.tsx @@ -1,12 +1,20 @@ -import { Group } from '@/components'; +import { Group, GroupProps } from '@/components'; import { SubscriptionPlan } from './SubscriptionPlan'; import { useSubscriptionPlans } from './hooks'; -export function SubscriptionPlans() { +interface SubscriptionPlansProps { + wrapProps?: GroupProps; + onSubscribe?: (variantId: number) => void; +} + +export function SubscriptionPlans({ + wrapProps, + onSubscribe +}: SubscriptionPlansProps) { const subscriptionPlans = useSubscriptionPlans(); return ( - + {subscriptionPlans.map((plan, index) => ( ))} diff --git a/packages/webapp/src/containers/Subscriptions/drawers/ChangeSubscriptionPlanDrawer/ChangeSubscriptionPlanDrawer.tsx b/packages/webapp/src/containers/Subscriptions/drawers/ChangeSubscriptionPlanDrawer/ChangeSubscriptionPlanDrawer.tsx new file mode 100644 index 000000000..a8aaf60ad --- /dev/null +++ b/packages/webapp/src/containers/Subscriptions/drawers/ChangeSubscriptionPlanDrawer/ChangeSubscriptionPlanDrawer.tsx @@ -0,0 +1,39 @@ +// @ts-nocheck +import React, { lazy } from 'react'; +import * as R from 'ramda'; +import { Drawer, DrawerHeaderContent, DrawerSuspense } from '@/components'; +import withDrawers from '@/containers/Drawer/withDrawers'; +import { Position } from '@blueprintjs/core'; +import { DRAWERS } from '@/constants/drawers'; + +const ChangeSubscriptionPlanContent = lazy( + () => import('./ChangeSubscriptionPlanContent'), +); + +/** + * Account drawer. + */ +function ChangeSubscriptionPlanDrawer({ + name, + // #withDrawer + isOpen, +}) { + return ( + + + + + + + ); +} + +export default R.compose(withDrawers())(ChangeSubscriptionPlanDrawer); diff --git a/packages/webapp/src/containers/Subscriptions/drawers/ChangeSubscriptionPlanDrawer/index.ts b/packages/webapp/src/containers/Subscriptions/drawers/ChangeSubscriptionPlanDrawer/index.ts new file mode 100644 index 000000000..4af1d02b2 --- /dev/null +++ b/packages/webapp/src/containers/Subscriptions/drawers/ChangeSubscriptionPlanDrawer/index.ts @@ -0,0 +1 @@ +export * as default from './ChangeSubscriptionPlanDrawer'; \ No newline at end of file