Skip to content

Commit

Permalink
feat: markdown for notifications (#175)
Browse files Browse the repository at this point in the history
* feat: markdown for notifications

* style: change not font to Inter

* chore: remove import
  • Loading branch information
diogogmatos authored Jan 16, 2024
1 parent 305b766 commit d62449a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
20 changes: 18 additions & 2 deletions components/Notifications/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from "react";

import moment from "moment-timezone";

import Markdown from "markdown-to-jsx";

import { INotDTO } from "../../dtos";

type BannerProps = {
Expand Down Expand Up @@ -55,7 +57,7 @@ const Banner = ({
} ease fixed inset-x-0 bottom-0 z-20 m-auto transform transition duration-300 sm:flex sm:max-w-8/10 sm:justify-center sm:pb-4`}
>
<div className="flex items-center justify-between gap-x-6 bg-cesium-900 px-6 py-2.5 pb-6 sm:rounded-xl sm:py-3 sm:pl-4 sm:pr-3.5 sm:shadow-md">
<div className="select-none text-sm leading-6 text-white">
<div className="select-none font-display text-sm leading-6 text-white">
<div>
<strong className="font-semibold">
<i className="bi bi-info-circle-fill"></i> {type}
Expand All @@ -67,7 +69,21 @@ const Banner = ({
>
<circle cx={1} cy={1} r={1} />
</svg>
{description}
<Markdown
options={{
overrides: {
a: {
props: {
className: "hover:underline",
target: "_blank",
rel: "noopener noreferrer",
},
},
},
}}
>
{description}
</Markdown>
</div>
</div>
<div className="flex justify-between gap-x-5 sm:gap-x-3">
Expand Down
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"html2canvas": "^1.4.1",
"ical-generator": "^5.0.1",
"jspdf": "^2.5.1",
"markdown-to-jsx": "^7.4.0",
"next": "^13.4.19",
"next-pwa": "^5.6.0",
"npm-run-all": "^4.1.5",
Expand Down

0 comments on commit d62449a

Please sign in to comment.