Skip to content

Commit

Permalink
Fix duplicate style entries, and keep custom css in menu at all times
Browse files Browse the repository at this point in the history
  • Loading branch information
glendaviesnz committed Jan 25, 2023
1 parent ea23a82 commit 37b5b3f
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions packages/edit-site/src/components/global-styles/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ const { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =

function GlobalStylesMenu() {
const { toggle } = useDispatch( preferencesStore );
const { useGlobalStylesReset, useGlobalStyle } = unlock(
blockEditorExperiments
);
const { useGlobalStylesReset } = unlock( blockEditorExperiments );
const [ canReset, onReset ] = useGlobalStylesReset();
const [ customCSS ] = useGlobalStyle( 'css' );
const { goTo } = useNavigator();
const loadCustomCSS = () => goTo( '/css' );
return (
Expand All @@ -62,14 +59,10 @@ function GlobalStylesMenu() {
onClick: onReset,
isDisabled: ! canReset,
},
...( ! customCSS
? [
{
title: __( 'Additional CSS' ),
onClick: loadCustomCSS,
},
]
: [] ),
{
title: __( 'Additional CSS' ),
onClick: loadCustomCSS,
},
{
title: __( 'Welcome Guide' ),
onClick: () =>
Expand Down Expand Up @@ -339,10 +332,6 @@ function GlobalStylesUI( { isStyleBookOpened, onCloseStyleBook } ) {
<GlobalStylesStyleBook onClose={ onCloseStyleBook } />
) }

<GlobalStylesNavigationScreen path="/css">
<ScreenCSS />
</GlobalStylesNavigationScreen>

<GlobalStylesMenu />
</NavigatorProvider>
);
Expand Down

0 comments on commit 37b5b3f

Please sign in to comment.