Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: markdown for notifications #175

Merged
merged 3 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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