AW-41-addFreeTrial
This commit is contained in:
parent
056b6c4f65
commit
f7af37c861
@ -3,4 +3,5 @@
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
@ -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<ISubscriptionPlan[]>([]);
|
||||
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 = () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user