Skip to content

Commit

Permalink
revert to using blocks in ListView
Browse files Browse the repository at this point in the history
  • Loading branch information
mxkae committed Mar 20, 2024
1 parent 81c4405 commit 9a03ad3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/block-components/navigation-view/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,22 @@ export const Edit = props => {
const {
height,
isOpen,
blocks,
isOnlyBlock,
rootClientId,
} = useSelect( select => {
const { rootBlockClientId, hasInnerBlocks } = select( 'stackable/block-context' ).getBlockContext( clientId )
const childBlocks = select( 'stackable/block-editor' )?.getClientTree( rootBlockClientId )

return {
height: select( 'stackable/navigation-view' ).getHeight(),
isOpen: select( 'stackable/navigation-view' ).getIsOpen(),
isOnlyBlock: ! hasInnerBlocks && rootBlockClientId === clientId,
rootClientId: rootBlockClientId,
blocks: [ {
clientId: rootBlockClientId,
innerBlocks: childBlocks,
} ],
}
} )

Expand Down Expand Up @@ -98,7 +105,7 @@ export const Edit = props => {
>
<div className="stk-panel--navigation-view__wrapper">
{ isOpen && <ListView
rootClientId={ rootClientId }
blocks={ blocks }
showOnlyCurrentHierarchy
showAppender
showBlockMovers
Expand Down

0 comments on commit 9a03ad3

Please sign in to comment.