Skip to content

Commit

Permalink
Parse disclaimer content
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinewi committed Dec 17, 2024
1 parent 8c15da5 commit d02f251
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/ndla-ui/src/Embed/UuDisclaimerEmbed.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import FactBox from "../FactBox";

const embedData: UuDisclaimerEmbedData = {
resource: "uu-disclaimer",
disclaimer: "Dette inholdet er ikke tastaturvennlig.",
disclaimer: "Dette inholdet er <strong>ikke</strong> tastaturvennlig.",
};

const meta: Meta<typeof UuDisclaimerEmbed> = {
Expand Down
5 changes: 3 additions & 2 deletions packages/ndla-ui/src/Embed/UuDisclaimerEmbed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
*
*/

import parse from "html-react-parser";
import { type ReactNode } from "react";
import { useTranslation } from "react-i18next";
import { Portal } from "@ark-ui/react";
import { AccessibilityFill } from "@ndla/icons";
import { Text, IconButton, PopoverContent, PopoverRoot, PopoverTrigger, PopoverTitle } from "@ndla/primitives";
import { IconButton, PopoverContent, PopoverRoot, PopoverTrigger, PopoverTitle } from "@ndla/primitives";
import { styled } from "@ndla/styled-system/jsx";
import type { UuDisclaimerMetaData } from "@ndla/types-embed";

Expand Down Expand Up @@ -57,7 +58,7 @@ const UuDisclaimerEmbed = ({ embed, children }: Props) => {
<Portal>
<PopoverContent>
<PopoverTitle>{t("uuDisclaimer.title")}</PopoverTitle>
<Text>{embedData.disclaimer}</Text>
<div>{parse(embedData.disclaimer)}</div>
</PopoverContent>
</Portal>
</PopoverRoot>
Expand Down

0 comments on commit d02f251

Please sign in to comment.