Skip to content

Commit

Permalink
feat: add rehype for better style
Browse files Browse the repository at this point in the history
  • Loading branch information
mamadoudicko committed Nov 1, 2023
1 parent 17e2a5e commit 43a580d
Show file tree
Hide file tree
Showing 3 changed files with 234 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Fragment } from "react";
import { MdClose } from "react-icons/md";
import ReactMarkdown from "react-markdown";
import rehypeRaw from "rehype-raw";

import Button from "@/lib/components/ui/Button";

Expand All @@ -24,7 +25,9 @@ export const NotificationBanner = (): JSX.Element => {
...notificationBanner.style,
}}
>
<ReactMarkdown>{notificationBanner.text}</ReactMarkdown>
<ReactMarkdown rehypePlugins={[rehypeRaw]}>
{notificationBanner.text}
</ReactMarkdown>
{Boolean(notificationBanner.dismissible) && (
<Button
variant="tertiary"
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"react-markdown": "^8.0.7",
"react-use": "^17.4.0",
"rehype-highlight": "^6.0.0",
"rehype-raw": "^7.0.0",
"sharp": "^0.32.4",
"tailwind-merge": "^1.12.0",
"tailwindcss": "3.3.2",
Expand Down
Loading

0 comments on commit 43a580d

Please sign in to comment.