Fix booking page when toggling payment app settings (#8451)

* Use getPaymentAppData on booking list item

* Use paymentAppdata for event type description

* Remove console.log

* Type fix

* Type fixes

* Remove updating event type price
This commit is contained in:
Joe Au-Yeung authored and GitHub committed 2023-04-21 15:43:31 -07:00
1 parent 600d2725aa
commit d97ac0e0f8
5 files changed
+17 -28

No files matched your search

@@ -4,6 +4,7 @@ import { useMemo } from "react";
import type { z } from "zod";
import { classNames, parseRecurringEvent } from "@calcom/lib";
import getPaymentAppData from "@calcom/lib/getPaymentAppData";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import type { baseEventTypeSelect } from "@calcom/prisma";
import type { EventTypeModel } from "@calcom/prisma/zod";
@@ -37,6 +38,8 @@ export const EventTypeDescription = ({
[eventType.recurringEvent]
);
const paymentAppData = getPaymentAppData(eventType);
return (
<>
<div className={classNames("text-subtle", className)}>
@@ -89,13 +92,13 @@ export const EventTypeDescription = ({
</Badge>
</li>
)}
{eventType.price > 0 && (
{paymentAppData.enabled && (
<li>
<Badge variant="gray" startIcon={CreditCard}>
{new Intl.NumberFormat(i18n.language, {
style: "currency",
currency: eventType.currency,
}).format(eventType.price / 100)}
currency: paymentAppData.currency,
}).format(paymentAppData.price / 100)}
</Badge>
</li>
)}