From f7af37c861afe0567ab45feac459a1b4c5cc79fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B5=D0=BD=D0=B8=D1=81=20=D0=9A=D0=B0=D1=82=D0=B0?= =?UTF-8?q?=D0=B5=D0=B2?= Date: Mon, 22 Apr 2024 22:20:54 +0000 Subject: [PATCH] AW-41-addFreeTrial --- src/components/PriceList/styles.module.css | 1 + src/components/pages/TrialChoice/index.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/PriceList/styles.module.css b/src/components/PriceList/styles.module.css index de269fd..7686405 100755 --- a/src/components/PriceList/styles.module.css +++ b/src/components/PriceList/styles.module.css @@ -3,4 +3,5 @@ display: flex; flex-direction: row; justify-content: space-between; + gap: 4px; } diff --git a/src/components/pages/TrialChoice/index.tsx b/src/components/pages/TrialChoice/index.tsx index 6fa1197..5e0b87c 100755 --- a/src/components/pages/TrialChoice/index.tsx +++ b/src/components/pages/TrialChoice/index.tsx @@ -1,6 +1,6 @@ import PriceList from "@/components/PriceList"; import styles from "./styles.module.css"; -import { useEffect, useState } from "react"; +import { useEffect, useMemo, useState } from "react"; import { ISubscriptionPlan } from "@/api/resources/SubscriptionPlans"; import { useTranslation } from "react-i18next"; import { useApi } from "@/api"; @@ -26,6 +26,7 @@ function TrialChoicePage() { const email = useSelector(selectors.selectEmail); const [subPlans, setSubPlans] = useState([]); const [isDisabled, setIsDisabled] = useState(true); + const allowedPlans = useMemo(() => ["stripe.37"], []); useEffect(() => { (async () => { @@ -39,7 +40,10 @@ function TrialChoicePage() { plansKeys[plan.name] = plansKeys[plan.name] ? plansKeys[plan.name] + 1 : 1; - if (plansKeys[plan.name] > 1 && !plan.trial?.is_free && !!plan.trial) { + if ( + (plansKeys[plan.name] > 1 && !plan.trial?.is_free && !!plan.trial) || + allowedPlans.includes(plan.id) + ) { const targetPlan = plansWithoutTest.find( (item) => item.name === plan.name && item.id.includes("stripe") ); @@ -62,6 +66,7 @@ function TrialChoicePage() { setSubPlans(plans); })(); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [api, locale]); const handlePriceItem = () => {