Skip to content

Commit

Permalink
Site Editor: Disable Settings/Styles buttons when Distruction Free Mo…
Browse files Browse the repository at this point in the history
…de is enabled
  • Loading branch information
t-hamano committed Jul 27, 2023
1 parent b0dbcf8 commit b099fd2
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ export default function DefaultSidebar( {
headerClassName,
panelClassName,
} ) {
const showIconLabels = useSelect(
( select ) => select( editSiteStore ).getSettings().showIconLabels,
[]
);
const { showIconLabels, isDistractionFree } = useSelect( ( select ) => {
const settings = select( editSiteStore ).getSettings();
return {
showIconLabels: settings.showIconLabels,
isDistractionFree: settings.isDistractionFree,
};
}, [] );

return (
<>
Expand All @@ -48,6 +51,7 @@ export default function DefaultSidebar( {
scope="core/edit-site"
identifier={ identifier }
icon={ icon }
disabled={ isDistractionFree }
>
{ title }
</ComplementaryAreaMoreMenuItem>
Expand Down

0 comments on commit b099fd2

Please sign in to comment.