From 1c46370572b554ee0e1a5c2fc42a5bae55b4ff66 Mon Sep 17 00:00:00 2001 From: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com> Date: Fri, 9 Sep 2022 14:10:58 +0530 Subject: [PATCH] dynamic link description on availability page (#4323) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../web/components/eventtype/EventTypeDescriptionSafeHTML.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/components/eventtype/EventTypeDescriptionSafeHTML.tsx b/apps/web/components/eventtype/EventTypeDescriptionSafeHTML.tsx index d60a64019c..0ce3f8636f 100644 --- a/apps/web/components/eventtype/EventTypeDescriptionSafeHTML.tsx +++ b/apps/web/components/eventtype/EventTypeDescriptionSafeHTML.tsx @@ -1,11 +1,13 @@ export type EventTypeDescriptionSafeProps = { - eventType: { description: string | null }; + eventType: { description: string | null; isDynamic?: boolean }; }; export const EventTypeDescriptionSafeHTML = ({ eventType }: EventTypeDescriptionSafeProps) => { const props: JSX.IntrinsicElements["div"] = { suppressHydrationWarning: true }; // @ts-expect-error: @see packages/prisma/middleware/eventTypeDescriptionParseAndSanitize.ts if (eventType.description) props.dangerouslySetInnerHTML = { __html: eventType.descriptionAsSafeHTML }; + // Dynamic link description is not set/pulled from the DB, hence we can allow it here as is + if (eventType.isDynamic) props.dangerouslySetInnerHTML = { __html: eventType.description || "" }; return
; };