From cbf5cd841cfde0dfb05774ce7cee24a3be2c4014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Thu, 20 Mar 2025 15:49:20 +0000 Subject: [PATCH] chore: use instance status prices in demo dialog plans --- .../BillingDashboard/BillingPlan/BillingPlan.tsx | 2 +- .../DemoDialog/DemoDialogPlans/DemoDialogPlans.tsx | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/src/component/admin/billing/BillingDashboard/BillingPlan/BillingPlan.tsx b/frontend/src/component/admin/billing/BillingDashboard/BillingPlan/BillingPlan.tsx index a5b18253ef..0c7690bbbb 100644 --- a/frontend/src/component/admin/billing/BillingDashboard/BillingPlan/BillingPlan.tsx +++ b/frontend/src/component/admin/billing/BillingDashboard/BillingPlan/BillingPlan.tsx @@ -130,7 +130,7 @@ export const BillingPlan = () => { 0} + condition={!isPAYG} show={ ${baseProPrice.toFixed(2)} diff --git a/frontend/src/component/demo/DemoDialog/DemoDialogPlans/DemoDialogPlans.tsx b/frontend/src/component/demo/DemoDialog/DemoDialogPlans/DemoDialogPlans.tsx index 9c517720e4..c038ef3e27 100644 --- a/frontend/src/component/demo/DemoDialog/DemoDialogPlans/DemoDialogPlans.tsx +++ b/frontend/src/component/demo/DemoDialog/DemoDialogPlans/DemoDialogPlans.tsx @@ -10,6 +10,7 @@ import { BILLING_PRO_BASE_PRICE, BILLING_PRO_DEFAULT_INCLUDED_SEATS, } from 'component/admin/billing/BillingDashboard/BillingPlan/BillingPlan'; +import { useInstanceStatus } from 'hooks/api/getters/useInstanceStatus/useInstanceStatus'; const StyledDemoDialog = styled(DemoDialog)(({ theme }) => ({ '& .MuiDialog-paper': { @@ -90,6 +91,12 @@ interface IDemoDialogPlansProps { export const DemoDialogPlans = ({ open, onClose }: IDemoDialogPlansProps) => { const { trackEvent } = usePlausibleTracker(); const isEnterprisePaygEnabled = useUiFlag('enterprise-payg'); + const { instanceStatus } = useInstanceStatus(); + + const paygSeatPrice = + instanceStatus?.prices?.payg?.seat ?? BILLING_PAYG_SEAT_PRICE; + const proBasePrice = + instanceStatus?.prices?.pro?.base ?? BILLING_PRO_BASE_PRICE; return ( @@ -138,7 +145,7 @@ export const DemoDialogPlans = ({ open, onClose }: IDemoDialogPlansProps) => {
- ${BILLING_PAYG_SEAT_PRICE} per user/month + ${paygSeatPrice} per user/month {BILLING_PAYG_DEFAULT_MINIMUM_SEATS} users @@ -173,7 +180,7 @@ export const DemoDialogPlans = ({ open, onClose }: IDemoDialogPlansProps) => {
- ${BILLING_PRO_BASE_PRICE}/month + ${proBasePrice}/month includes {BILLING_PRO_DEFAULT_INCLUDED_SEATS}{' '}