Skip to content

Commit

Permalink
Refactor global styles sidebar wrapper preview menu
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Nov 29, 2024
1 parent d9bd607 commit 80fd097
Showing 1 changed file with 36 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,43 @@ const GlobalStylesPageActions = ( {
setIsStyleBookOpened,
} ) => {
return (
<Menu
trigger={
<Button __next40pxDefaultSize variant="tertiary" size="compact">
{ __( 'Preview' ) }
</Button>
}
>
<Menu.RadioItem
value
checked={ isStyleBookOpened }
name="styles-preview-actions"
onChange={ () => setIsStyleBookOpened( true ) }
defaultChecked
>
<Menu.ItemLabel>{ __( 'Style book' ) }</Menu.ItemLabel>
<Menu.ItemHelpText>
{ __( 'Preview blocks and styles.' ) }
</Menu.ItemHelpText>
</Menu.RadioItem>
<Menu.RadioItem
value={ false }
checked={ ! isStyleBookOpened }
name="styles-preview-actions"
onChange={ () => setIsStyleBookOpened( false ) }
<Menu>
<Menu.TriggerButton
render={
<Button
__next40pxDefaultSize
variant="tertiary"
size="compact"
/>
}
>
<Menu.ItemLabel>{ __( 'Site' ) }</Menu.ItemLabel>
<Menu.ItemHelpText>
{ __( 'Preview your site.' ) }
</Menu.ItemHelpText>
</Menu.RadioItem>
{ __( 'Preview' ) }
</Menu.TriggerButton>
<Menu.Popover>
<Menu.RadioItem
value
checked={ isStyleBookOpened }
name="styles-preview-actions"
onChange={ () => setIsStyleBookOpened( true ) }
defaultChecked
>
<Menu.ItemLabel>{ __( 'Style book' ) }</Menu.ItemLabel>
<Menu.ItemHelpText>
{ __( 'Preview blocks and styles.' ) }
</Menu.ItemHelpText>
</Menu.RadioItem>
<Menu.RadioItem
value={ false }
checked={ ! isStyleBookOpened }
name="styles-preview-actions"
onChange={ () => setIsStyleBookOpened( false ) }
>
<Menu.ItemLabel>{ __( 'Site' ) }</Menu.ItemLabel>
<Menu.ItemHelpText>
{ __( 'Preview your site.' ) }
</Menu.ItemHelpText>
</Menu.RadioItem>
</Menu.Popover>
</Menu>
);
};
Expand Down

0 comments on commit 80fd097

Please sign in to comment.