Skip to content

Commit

Permalink
Refactor block bindings panel menu (#67633)
Browse files Browse the repository at this point in the history
Co-authored-by: ciampo <[email protected]>
  • Loading branch information
ciampo and ciampo committed Dec 13, 2024
1 parent f292733 commit ea4dd0c
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions packages/block-editor/src/hooks/block-bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const useToolsPanelDropdownMenuProps = () => {
: {};
};

function BlockBindingsPanelDropdown( { fieldsList, attribute, binding } ) {
function BlockBindingsPanelMenuContent( { fieldsList, attribute, binding } ) {
const { clientId } = useBlockEditContext();
const registeredSources = getBlockBindingsSources();
const { updateBlockBindings } = useBlockBindingsUtils();
Expand Down Expand Up @@ -179,22 +179,21 @@ function EditableBlockBindingsPanelItems( {
placement={
isMobile ? 'bottom-start' : 'left-start'
}
gutter={ isMobile ? 8 : 36 }
trigger={
<Item>
<BlockBindingsAttribute
attribute={ attribute }
binding={ binding }
fieldsList={ fieldsList }
/>
</Item>
}
>
<BlockBindingsPanelDropdown
fieldsList={ fieldsList }
attribute={ attribute }
binding={ binding }
/>
<Menu.TriggerButton render={ <Item /> }>
<BlockBindingsAttribute
attribute={ attribute }
binding={ binding }
fieldsList={ fieldsList }
/>
</Menu.TriggerButton>
<Menu.Popover gutter={ isMobile ? 8 : 36 }>
<BlockBindingsPanelMenuContent
fieldsList={ fieldsList }
attribute={ attribute }
binding={ binding }
/>
</Menu.Popover>
</Menu>
</ToolsPanelItem>
);
Expand Down

0 comments on commit ea4dd0c

Please sign in to comment.