react-notion-x
react-notion-x copied to clipboard
Remove page cover position if cover doesn't exist (#351)
Description
Remove the page_cover_position if the page_cover doesn't exist in a block format. This allows the block to use the defaultPageCoverPosition for defaultPageCover.
#351 explains that a cover page_cover_position can exist for a page that doesn't have a page_cover if the cover was removed.
Notion pages seem to keep the
page_cover_positionin a pageformateven if the cover was removed. TheBlockcomponent frompackages/react-notion-x/src/block.tsxuses thepage_cover_positionfrom the pageformatif it's available instead of thedefaultPageCoverPosition.
The problem happens when using
NotionRendererwithdefaultPageCoveranddefaultPageCoverPositionwith a page that used to have a cover. In this case it uses thepage_cover_positionfrom the cover that was removed with thedefaultPageCover.defaultPageCoverPositionis ignored.
Notion Test Page ID
This page used to have a cover and has a numeric page_cover_position value as part of its format. It doesn't have page_cover as part of its format.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated |
|---|---|---|---|---|
| react-notion-x | ❌ Failed (Inspect) | Feb 9, 2023 at 1:33PM (UTC) | ||
| react-notion-x-minimal-demo | ❌ Failed (Inspect) | Feb 9, 2023 at 1:33PM (UTC) |
FYI @transitive-bullshit this is one ready to be merged