From f795a472e8145e51f72f333205b5b6be265c1223 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Mon, 1 Feb 2021 23:43:06 -0500 Subject: [PATCH] feat: add Pdf and Equation by default; fix Pdf --- components/NotionPage.tsx | 10 +++++++++- package.json | 2 +- styles/notion.css | 4 ++++ yarn.lock | 8 ++++---- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/components/NotionPage.tsx b/components/NotionPage.tsx index 71be41b..22f92df 100644 --- a/components/NotionPage.tsx +++ b/components/NotionPage.tsx @@ -50,6 +50,12 @@ import styles from './styles.module.css' // } // ) +const Pdf = dynamic(() => import('react-notion-x').then((notion) => notion.Pdf)) + +const Equation = dynamic(() => + import('react-notion-x').then((notion) => notion.Equation) +) + const Tweet = dynamic( () => import('react-notion-x').then((notion) => notion.Tweet), { @@ -230,7 +236,9 @@ export const NotionPage: React.FC = ({ collection: Collection, collectionRow: CollectionRow, tweet: Tweet, - modal: Modal + modal: Modal, + pdf: Pdf, + equation: Equation }} recordMap={recordMap} rootPageId={site.rootNotionPageId} diff --git a/package.json b/package.json index 164f67c..a04c3ab 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "react-body-classname": "^1.3.1", "react-dom": "17.0.1", "react-icons": "^4.1.0", - "react-notion-x": "^4.2.2", + "react-notion-x": "^4.2.3", "react-use": "^15.3.3", "use-dark-mode": "^2.3.1" }, diff --git a/styles/notion.css b/styles/notion.css index 179f4f8..3b29d2b 100644 --- a/styles/notion.css +++ b/styles/notion.css @@ -312,3 +312,7 @@ border-radius: 0; background: none !important; } + +.notion-block-f382a57807bc40779860eb079d0144f2 .lazy-image-wrapper { + border-radius: 16px; +} diff --git a/yarn.lock b/yarn.lock index 1f54812..f5ff1c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4110,10 +4110,10 @@ react-modal@^3.11.2: react-lifecycles-compat "^3.0.0" warning "^4.0.3" -react-notion-x@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/react-notion-x/-/react-notion-x-4.2.2.tgz#16197818f54d418f4f272a018d8464b84b55f8bc" - integrity sha512-W0tHCHwKVLtnZa8PK8hssxhWvvrh/yLRvfJ4DKY3HvXiYsJFt7CtTSkzMtpL915RsDxpZSLRu/o5nfgenLtSVQ== +react-notion-x@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/react-notion-x/-/react-notion-x-4.2.3.tgz#d0e4ae6677ccd3dff5be5f6918b8602dbebbf28c" + integrity sha512-N6r0KqUPriQM2cjt6AuKOuEwJpFKIo7Kevjz2+uyErbixAjd2wvwXGHhZbq9ZRmICwunoNp0KqC9EWHeDsY2NA== dependencies: "@matejmazur/react-katex" "^3.1.3" date-fns "^2.15.0"