Skip to content

Commit

Permalink
Refactor global styles shadows edit panel menu (#67641)
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Dec 12, 2024
1 parent 83aa04c commit 08abefc
Showing 1 changed file with 32 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,33 +163,38 @@ export default function ShadowsEditPanel() {
<ScreenHeader title={ selectedShadow.name } />
<FlexItem>
<Spacer marginTop={ 2 } marginBottom={ 0 } paddingX={ 4 }>
<Menu
trigger={
<Button
size="small"
icon={ moreVertical }
label={ __( 'Menu' ) }
/>
}
>
{ ( category === 'custom'
? customShadowMenuItems
: presetShadowMenuItems
).map( ( item ) => (
<Menu.Item
key={ item.action }
onClick={ () => onMenuClick( item.action ) }
disabled={
item.action === 'reset' &&
selectedShadow.shadow ===
baseSelectedShadow.shadow
}
>
<Menu.ItemLabel>
{ item.label }
</Menu.ItemLabel>
</Menu.Item>
) ) }
<Menu>
<Menu.TriggerButton
render={
<Button
size="small"
icon={ moreVertical }
label={ __( 'Menu' ) }
/>
}
/>
<Menu.Popover>
{ ( category === 'custom'
? customShadowMenuItems
: presetShadowMenuItems
).map( ( item ) => (
<Menu.Item
key={ item.action }
onClick={ () =>
onMenuClick( item.action )
}
disabled={
item.action === 'reset' &&
selectedShadow.shadow ===
baseSelectedShadow.shadow
}
>
<Menu.ItemLabel>
{ item.label }
</Menu.ItemLabel>
</Menu.Item>
) ) }
</Menu.Popover>
</Menu>
</Spacer>
</FlexItem>
Expand Down

0 comments on commit 08abefc

Please sign in to comment.