react-notion-x
react-notion-x copied to clipboard
feat: support bodyClassName when omitting fullPage
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:
classNameandbodyClassNameof<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
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) |