From ef3ec7274c0d97e4a0e81dacbf11c7d959d07f80 Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Wed, 4 Jun 2025 17:29:45 +0530 Subject: [PATCH] [WEB-4253] improvement: minor enhancements to billing page (#7160) --- .../license/modal/card/plan-upgrade.tsx | 2 ++ .../license/modal/card/talk-to-sales.tsx | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/web/core/components/license/modal/card/plan-upgrade.tsx b/web/core/components/license/modal/card/plan-upgrade.tsx index fca1a013d7..ef21459c61 100644 --- a/web/core/components/license/modal/card/plan-upgrade.tsx +++ b/web/core/components/license/modal/card/plan-upgrade.tsx @@ -56,12 +56,14 @@ export const PlanUpgradeCard: FC = observer((props) => { href={TALK_TO_SALES_URL} isLoading={isLoading} features={features} + product={product} prices={prices} upgradeLoaderType={upgradeLoaderType} verticalFeatureList={verticalFeatureList} extraFeatures={extraFeatures} isSelfHosted={isSelfHosted} isTrialAllowed={isTrialAllowed} + renderTrialButton={renderTrialButton} /> ); } diff --git a/web/core/components/license/modal/card/talk-to-sales.tsx b/web/core/components/license/modal/card/talk-to-sales.tsx index a136d65963..cfd5e77441 100644 --- a/web/core/components/license/modal/card/talk-to-sales.tsx +++ b/web/core/components/license/modal/card/talk-to-sales.tsx @@ -5,7 +5,7 @@ import { observer } from "mobx-react"; // types import { EProductSubscriptionEnum } from "@plane/constants"; // plane imports -import { TSubscriptionPrice } from "@plane/types"; +import { IPaymentProduct, TSubscriptionPrice } from "@plane/types"; import { getButtonStyling, Loader } from "@plane/ui"; import { cn } from "@plane/utils"; // plane web imports @@ -18,12 +18,14 @@ export type TalkToSalesCardProps = { href: string; isLoading?: boolean; features: string[]; + product: IPaymentProduct | undefined; prices: TSubscriptionPrice[]; upgradeLoaderType: Omit | undefined; verticalFeatureList?: boolean; extraFeatures?: string | React.ReactNode; isSelfHosted: boolean; isTrialAllowed: boolean; + renderTrialButton?: (props: { productId: string | undefined; priceId: string | undefined }) => React.ReactNode; }; export const TalkToSalesCard: FC = observer((props) => { @@ -31,6 +33,7 @@ export const TalkToSalesCard: FC = observer((props) => { planVariant, href, features, + product, prices, isLoading, verticalFeatureList = false, @@ -38,6 +41,7 @@ export const TalkToSalesCard: FC = observer((props) => { upgradeLoaderType, isSelfHosted, isTrialAllowed, + renderTrialButton, } = props; const renderPriceContent = (price: TSubscriptionPrice) => ( @@ -47,7 +51,7 @@ export const TalkToSalesCard: FC = observer((props) => { ); - const renderActionButton = () => { + const renderActionButton = (price: TSubscriptionPrice) => { const upgradeButtonStyle = getUpgradeButtonStyle(planVariant, !!upgradeLoaderType) ?? getButtonStyling("primary", "lg", !!upgradeLoaderType); @@ -81,7 +85,15 @@ export const TalkToSalesCard: FC = observer((props) => { > Talk to Sales - {isTrialAllowed && !isSelfHosted &&
} + {isTrialAllowed && !isSelfHosted && ( +
+ {renderTrialButton && + renderTrialButton({ + productId: product?.id, + priceId: price.id, + })} +
+ )}
)}