react-notion-x icon indicating copy to clipboard operation
react-notion-x copied to clipboard

feat: support bodyClassName when omitting fullPage

Open bytrangle opened this issue 3 years ago • 1 comments
trafficstars

Description

Probably fixes #316

When fullPage of component <NotionRenderer> is omitted or set to false, both className and bodyClassName are assigned to the <main> element.

<main
              className={cs(
                'notion',
                darkMode ? 'dark-mode' : 'light-mode',
                'notion-page',
                page_full_width && 'notion-full-width',
                page_small_text && 'notion-small-text',
                blockId,
                className
              )}
            >
</main>

I think this will:

  • defeat the purpose of having two separate props: className and bodyClassName of <NotionRenderer>.
  • take away the users' opportunity for controlling the markup with CSS.

So I wrapped the children blocks in an extra element and added bodyClassName to it.

Notion Test Page ID

bytrangle avatar Jul 04 '22 08:07 bytrangle

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
react-notion-x ✅ Ready (Inspect) Visit Preview Jul 4, 2022 at 8:07AM (UTC)
react-notion-x-minimal-demo ✅ Ready (Inspect) Visit Preview Jul 4, 2022 at 8:07AM (UTC)

vercel[bot] avatar Jul 04 '22 08:07 vercel[bot]