From f448186a3d309c5ca2b2d478687c0f23c7fbdc69 Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Mon, 27 Mar 2023 10:14:51 +0100 Subject: [PATCH] Add button to switch to edit mode and open global styles sidebar --- .../index.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js b/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js index 590d1cdfa00e5a..f9261ebc06d43f 100644 --- a/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js +++ b/packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js @@ -2,14 +2,21 @@ * WordPress dependencies */ import { __ } from '@wordpress/i18n'; +import { brush } from '@wordpress/icons'; +import { useDispatch } from '@wordpress/data'; /** * Internal dependencies */ import SidebarNavigationScreen from '../sidebar-navigation-screen'; import StyleVariationsContainer from '../global-styles/style-variations-container'; +import { unlock } from '../../private-apis'; +import { store as editSiteStore } from '../../store'; +import SidebarButton from '../sidebar-button'; export default function SidebarNavigationScreenGlobalStyles() { + const { openGeneralSidebar } = useDispatch( editSiteStore ); + const { setCanvasMode } = unlock( useDispatch( editSiteStore ) ); return ( } + actions={ + { + // switch to edit mode. + setCanvasMode( 'edit' ); + // open global styles sidebar. + openGeneralSidebar( 'edit-site/global-styles' ); + } } + /> + } /> ); }