From 8705e71f57f81828a09102fe23fd4b01092380f0 Mon Sep 17 00:00:00 2001 From: Mehdi Hamri <143011364+pixelfact@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:03:11 +0100 Subject: [PATCH] Add billing profile selection sidepanel (#632) --- .../activity-section/activity-section.tsx | 17 ++++ .../_translations/my-dashboard.en.json | 3 + app/my-dashboard/page.tsx | 23 ++--- .../billing-profile/client/index.ts | 2 + .../billing-profile/billing-profile.types.ts | 9 ++ .../_translations/features.translate.ts | 4 + .../add-new-billing-profile-card.en.json | 3 + .../add-new-billing-profile-card.tsx | 29 ++++++ .../billing-profile-card.en.json | 4 + .../billing-profile-card.tsx | 68 ++++++++++++++ .../billing-profile-card.types.ts | 11 +++ .../billing-profile-selection.en.json | 1 + .../billing-profile-selection.hooks.ts | 5 ++ .../billing-profile-selection.tsx | 88 +++++++++++++++++++ .../billing-profile-selection.types.ts | 1 + .../use-billing-profile-icons.tsx | 17 ++++ .../request-payment-flow.context.tsx | 8 +- .../translations/common/common.en.json | 8 +- 18 files changed, 289 insertions(+), 12 deletions(-) create mode 100644 shared/panels/_flows/request-payment-flow/_panels/_components/add-new-billing-profile-card/add-new-billing-profile-card.en.json create mode 100644 shared/panels/_flows/request-payment-flow/_panels/_components/add-new-billing-profile-card/add-new-billing-profile-card.tsx create mode 100644 shared/panels/_flows/request-payment-flow/_panels/_components/billing-profile-card/billing-profile-card.en.json create mode 100644 shared/panels/_flows/request-payment-flow/_panels/_components/billing-profile-card/billing-profile-card.tsx create mode 100644 shared/panels/_flows/request-payment-flow/_panels/_components/billing-profile-card/billing-profile-card.types.ts create mode 100644 shared/panels/_flows/request-payment-flow/_panels/billing-profile-selection/_translations/billing-profile-selection.en.json create mode 100644 shared/panels/_flows/request-payment-flow/_panels/billing-profile-selection/billing-profile-selection.hooks.ts create mode 100644 shared/panels/_flows/request-payment-flow/_panels/billing-profile-selection/billing-profile-selection.tsx create mode 100644 shared/panels/_flows/request-payment-flow/_panels/billing-profile-selection/billing-profile-selection.types.ts create mode 100644 shared/panels/_flows/request-payment-flow/_panels/hooks/use-billing-profile-icons/use-billing-profile-icons.tsx diff --git a/app/my-dashboard/_sections/activity-section/activity-section.tsx b/app/my-dashboard/_sections/activity-section/activity-section.tsx index 0f680eb49..ea5302619 100644 --- a/app/my-dashboard/_sections/activity-section/activity-section.tsx +++ b/app/my-dashboard/_sections/activity-section/activity-section.tsx @@ -1,12 +1,15 @@ +import { ChevronRight } from "lucide-react"; import { useMemo, useState } from "react"; import { Contributions } from "@/app/my-dashboard/_features/contributions/contributions"; import { RewardsTable } from "@/app/my-dashboard/_features/rewards-table/rewards-table"; +import { Button } from "@/design-system/atoms/button/variants/button-default"; import { Typo } from "@/design-system/atoms/typo"; import { Tabs } from "@/design-system/molecules/tabs/tabs"; import { useSidePanelsContext } from "@/shared/features/side-panels/side-panels.context"; +import { useRequestPaymentFlow } from "@/shared/panels/_flows/request-payment-flow/request-payment-flow.context"; import { Translate } from "@/shared/translation/components/translate/translate"; enum ActivityTabs { @@ -17,6 +20,7 @@ enum ActivityTabs { export function ActivitySection() { const { close } = useSidePanelsContext(); + const { open: openRequestPaymentFlow } = useRequestPaymentFlow(); const [toggleActivityView, setToggleActivityView] = useState(ActivityTabs.CONTRIBUTIONS); const renderActivityView = useMemo(() => { @@ -71,6 +75,19 @@ export function ActivitySection() { ]} selectedId={toggleActivityView} /> + {/*TODO move this button to the right bloc and add rewards count*/} +