Fixes Dynamic Link description Logic (#4351)

* fixes logic

* fixes description

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Syed Ali Shahbaz
2022-09-12 15:34:42 +05:30
committed by GitHub
co-authored by kodiakhq[bot]
parent 20fd45a3fd
commit 9557c1818b
2 changed files with 4 additions and 3 deletions
@@ -1,13 +1,11 @@
export type EventTypeDescriptionSafeProps = {
eventType: { description: string | null; isDynamic?: boolean };
eventType: { description: string | null };
};
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 <div {...props} />;
};
+3
View File
@@ -93,6 +93,7 @@ const min15Event = {
title: "15min",
eventName: "Dynamic Collective 15min Event",
description: "Dynamic Collective 15min Event",
descriptionAsSafeHTML: "Dynamic Collective 15min Event",
position: 0,
...commons,
};
@@ -102,6 +103,7 @@ const min30Event = {
title: "30min",
eventName: "Dynamic Collective 30min Event",
description: "Dynamic Collective 30min Event",
descriptionAsSafeHTML: "Dynamic Collective 30min Event",
position: 1,
...commons,
};
@@ -111,6 +113,7 @@ const min60Event = {
title: "60min",
eventName: "Dynamic Collective 60min Event",
description: "Dynamic Collective 60min Event",
descriptionAsSafeHTML: "Dynamic Collective 60min Event",
position: 2,
...commons,
};