Skip to content

Scheduling infrastructure for absolutely everyone.

Fixes location in payment page (#918)

Omar López9539d26ac787
diff --git a/ee/components/stripe/PaymentPage.tsx b/ee/components/stripe/PaymentPage.tsx
index 5beb2e23cc8..24a4bf28c1a 100644
--- a/ee/components/stripe/PaymentPage.tsx
+++ b/ee/components/stripe/PaymentPage.tsx
@@ -78,7 +78,7 @@ const PaymentPage: FC<PaymentPageProps> = (props) => {
{props.booking.location && (
<>
<div className="font-medium">Where</div>
- <div className="col-span-2">{location}</div>
+ <div className="mb-6 col-span-2">{props.booking.location}</div>
</>
)}
<div className="font-medium">Price</div>
diff --git a/ee/pages/payment/[uid].tsx b/ee/pages/payment/[uid].tsx
index df2932469c2..5666119b43b 100644
--- a/ee/pages/payment/[uid].tsx
+++ b/ee/pages/payment/[uid].tsx
@@ -1,14 +1,18 @@
import { GetServerSidePropsContext } from "next";
+import { serverSideTranslations } from "next-i18next/serverSideTranslations";
import { PaymentData } from "@ee/lib/stripe/server";
import { asStringOrThrow } from "@lib/asStringOrNull";
+import { getOrSetUserLocaleFromHeaders } from "@lib/core/i18n/i18n.utils";
import prisma from "@lib/prisma";
import { inferSSRProps } from "@lib/types/inferSSRProps";
export type PaymentPageProps = inferSSRProps<typeof getServerSideProps>;
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
+ const locale = await getOrSetUserLocaleFromHeaders(context.req);
+
const rawPayment = await prisma.payment.findFirst({
where: {
uid: asStringOrThrow(context.query.uid),
@@ -99,6 +103,8 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
booking,
payment,
profile,
+ localeProp: locale,
+ ...(await serverSideTranslations(locale, ["common"])),
},
};
};