🐛 Removing ts pattern
This commit is contained in:
parent
de1c5aaf8e
commit
f933b58ee5
@ -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"
|
||||
}
|
||||
|
@ -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<HTMLInputElement>) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user