From 63f91538f225cb753531181ad3a557b3f95ef5da Mon Sep 17 00:00:00 2001 From: Diogo Matos Date: Tue, 16 Jan 2024 11:43:01 +0000 Subject: [PATCH 1/3] feat: markdown for notifications --- components/Notifications/Notifications.tsx | 20 +++++++++++++++++++- package-lock.json | 18 ++++++++++++++++++ package.json | 1 + 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/components/Notifications/Notifications.tsx b/components/Notifications/Notifications.tsx index f20b8735..528e2210 100644 --- a/components/Notifications/Notifications.tsx +++ b/components/Notifications/Notifications.tsx @@ -2,6 +2,10 @@ import React from "react"; import moment from "moment-timezone"; +import Markdown from "markdown-to-jsx"; + +import { render } from "react-dom"; + import { INotDTO } from "../../dtos"; type BannerProps = { @@ -67,7 +71,21 @@ const Banner = ({ > - {description} + + {description} +
diff --git a/package-lock.json b/package-lock.json index aa81ab10..263532e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,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", @@ -7897,6 +7898,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/markdown-to-jsx": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/markdown-to-jsx/-/markdown-to-jsx-7.4.0.tgz", + "integrity": "sha512-zilc+MIkVVXPyTb4iIUTIz9yyqfcWjszGXnwF9K/aiBWcHXFcmdEMTkG01/oQhwSCH7SY1BnG6+ev5BzWmbPrg==", + "engines": { + "node": ">= 10" + }, + "peerDependencies": { + "react": ">= 0.14.0" + } + }, "node_modules/mathml-tag-names": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", @@ -18080,6 +18092,12 @@ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==" }, + "markdown-to-jsx": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/markdown-to-jsx/-/markdown-to-jsx-7.4.0.tgz", + "integrity": "sha512-zilc+MIkVVXPyTb4iIUTIz9yyqfcWjszGXnwF9K/aiBWcHXFcmdEMTkG01/oQhwSCH7SY1BnG6+ev5BzWmbPrg==", + "requires": {} + }, "mathml-tag-names": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", diff --git a/package.json b/package.json index 9a2cb127..97fd3eef 100644 --- a/package.json +++ b/package.json @@ -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", From cd249f45eaf1f150a71a9c06422db0d2d59017ca Mon Sep 17 00:00:00 2001 From: Diogo Matos Date: Tue, 16 Jan 2024 12:00:47 +0000 Subject: [PATCH 2/3] style: change not font to Inter --- components/Notifications/Notifications.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Notifications/Notifications.tsx b/components/Notifications/Notifications.tsx index 528e2210..6c75119b 100644 --- a/components/Notifications/Notifications.tsx +++ b/components/Notifications/Notifications.tsx @@ -59,7 +59,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`} >
-
+
{type} From d9f75483171032896abbee6c63f6293335d0456e Mon Sep 17 00:00:00 2001 From: Diogo Matos Date: Tue, 16 Jan 2024 12:04:05 +0000 Subject: [PATCH 3/3] chore: remove import --- components/Notifications/Notifications.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/Notifications/Notifications.tsx b/components/Notifications/Notifications.tsx index 6c75119b..74018245 100644 --- a/components/Notifications/Notifications.tsx +++ b/components/Notifications/Notifications.tsx @@ -4,8 +4,6 @@ import moment from "moment-timezone"; import Markdown from "markdown-to-jsx"; -import { render } from "react-dom"; - import { INotDTO } from "../../dtos"; type BannerProps = {