diff --git a/package.json b/package.json index 2b5e4e6c..870848ea 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "react-toastify": "^9.1.3", "sass": "^1.59.2", "sharp": "^0.32.1", - "ts-pattern": "^4.3.0", "typescript": "4.9.5", "uuidv4": "^6.2.13" } diff --git a/src/front/Components/Layouts/Subscription/Components/SubscribeCheckoutTicket/index.tsx b/src/front/Components/Layouts/Subscription/Components/SubscribeCheckoutTicket/index.tsx index da20e7bc..76339377 100644 --- a/src/front/Components/Layouts/Subscription/Components/SubscribeCheckoutTicket/index.tsx +++ b/src/front/Components/Layouts/Subscription/Components/SubscribeCheckoutTicket/index.tsx @@ -8,7 +8,6 @@ import classnames from "classnames"; import { EType } from "le-coffre-resources/dist/Admin/Subscription"; import Stripe from "@Front/Api/LeCoffreApi/Admin/Stripe/Stripe"; import { useRouter } from "next/router"; -import * as P from "ts-pattern"; type IProps = { forfeitType: EForfeitType; @@ -37,15 +36,13 @@ export default function SubscribeCheckoutTicket(props: IProps) { useEffect(() => { let multiplierToUse = paymentFrequency === EPaymentFrequency.yearly ? multiplier - 1 : multiplier; - P.match(forfeitType) - .with(EForfeitType.standard, () => { - setTotalPlan(forfeitsPrices[EForfeitType.standard] * multiplierToUse); - setTotalCollaborator(collaboratorPrice * numberOfCollaborators * multiplier); - }) - .with(EForfeitType.unlimited, () => { - setTotalPlan(forfeitsPrices[EForfeitType.unlimited] * multiplierToUse); - setTotalCollaborator(0); - }); + if (forfeitType === EForfeitType.unlimited) { + setTotalPlan(forfeitsPrices[EForfeitType.unlimited] * multiplierToUse); + setTotalCollaborator(0); + } else { + setTotalPlan(forfeitsPrices[EForfeitType.standard] * multiplierToUse); + setTotalCollaborator(collaboratorPrice * numberOfCollaborators * multiplier); + } }, [multiplier, forfeitType, numberOfCollaborators, paymentFrequency]); const handleFrequencyChange = (e: React.ChangeEvent) => {