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

Mirror Notion in hiding block_width "0" assets #550

Open
PascalPixel opened this issue Apr 19, 2024 · 0 comments
Open

Mirror Notion in hiding block_width "0" assets #550

PascalPixel opened this issue Apr 19, 2024 · 0 comments

Comments

@PascalPixel
Copy link

PascalPixel commented Apr 19, 2024

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Sometimes, images that seem 'deleted' in Notion are still in the blocks, but simply have a "block_width" of 0. This diff would hide those blocks to match Notion.

Here is the diff that solved my problem:

diff --git a/node_modules/react-notion-x/build/index.js b/node_modules/react-notion-x/build/index.js
index a18bcfd..1bc6916 100644
--- a/node_modules/react-notion-x/build/index.js
+++ b/node_modules/react-notion-x/build/index.js
@@ -1757,8 +1760,9 @@ var AssetWrapper = ({ blockId, block }) => {
       "notion-asset-wrapper",
       `notion-asset-wrapper-${block.type}`,
       ((_d = value.format) == null ? void 0 : _d.block_full_width) && "notion-asset-wrapper-full",
-    )
+    ),
+    style: ((_d = value.format) == null ? void 0 : _d.block_width) === 0 ? { display: "none" } : undefined,
   }, /* @__PURE__ */ React20.createElement(Asset, {
     block: value,
     zoomable: zoom && !isURL

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant