From e863b71dfaeb2ab8698eb4d7e5296f23cc77f626 Mon Sep 17 00:00:00 2001 From: zomars Date: Tue, 7 Jun 2022 08:49:39 -0600 Subject: [PATCH] Email language fixes --- packages/emails/src/components/LocationInfo.tsx | 6 ++++-- packages/emails/src/components/WhoInfo.tsx | 6 ++++-- packages/emails/src/templates/BaseScheduledEmail.tsx | 6 +++--- packages/emails/src/templates/ForgotPasswordEmail.tsx | 2 +- packages/emails/src/templates/TeamInviteEmail.tsx | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/emails/src/components/LocationInfo.tsx b/packages/emails/src/components/LocationInfo.tsx index 6341f4f37c..4a985aac66 100644 --- a/packages/emails/src/components/LocationInfo.tsx +++ b/packages/emails/src/components/LocationInfo.tsx @@ -1,11 +1,13 @@ +import type { TFunction } from "next-i18next"; + import { getAppName } from "@calcom/app-store/utils"; import type { CalendarEvent } from "@calcom/types/Calendar"; import { Info } from "./Info"; import { LinkIcon } from "./LinkIcon"; -export function LocationInfo(props: { calEvent: CalendarEvent }) { - const t = props.calEvent.attendees[0].language.translate; +export function LocationInfo(props: { calEvent: CalendarEvent; t: TFunction }) { + const { t } = props; let providerName = props.calEvent.location && getAppName(props.calEvent.location); if (props.calEvent.location && props.calEvent.location.includes("integrations:")) { diff --git a/packages/emails/src/components/WhoInfo.tsx b/packages/emails/src/components/WhoInfo.tsx index 0b9505658e..f9d720f465 100644 --- a/packages/emails/src/components/WhoInfo.tsx +++ b/packages/emails/src/components/WhoInfo.tsx @@ -1,3 +1,5 @@ +import { TFunction } from "next-i18next"; + import type { CalendarEvent } from "@calcom/types/Calendar"; import { Info } from "./Info"; @@ -13,8 +15,8 @@ const PersonInfo = ({ name = "", email = "", role = "" }) => ( ); -export function WhoInfo(props: { calEvent: CalendarEvent }) { - const t = props.calEvent.attendees[0].language.translate; +export function WhoInfo(props: { calEvent: CalendarEvent; t: TFunction }) { + const { t } = props; return ( - - + + diff --git a/packages/emails/src/templates/ForgotPasswordEmail.tsx b/packages/emails/src/templates/ForgotPasswordEmail.tsx index 045d48acf7..704bfb7a22 100644 --- a/packages/emails/src/templates/ForgotPasswordEmail.tsx +++ b/packages/emails/src/templates/ForgotPasswordEmail.tsx @@ -1,4 +1,4 @@ -import { TFunction } from "next-i18next"; +import type { TFunction } from "next-i18next"; import { BaseEmailHtml, CallToAction } from "../components"; diff --git a/packages/emails/src/templates/TeamInviteEmail.tsx b/packages/emails/src/templates/TeamInviteEmail.tsx index af965f024f..19ef631fea 100644 --- a/packages/emails/src/templates/TeamInviteEmail.tsx +++ b/packages/emails/src/templates/TeamInviteEmail.tsx @@ -1,4 +1,4 @@ -import { TFunction } from "next-i18next"; +import type { TFunction } from "next-i18next"; import { BaseEmailHtml, CallToAction } from "../components";