From c35969806bac999549bc65b39dcea3448a073b28 Mon Sep 17 00:00:00 2001 From: Heiko Mamerow Date: Thu, 19 Oct 2023 16:07:47 +0200 Subject: [PATCH 1/3] feature(Revision history): Switch from dropdown to normal button and show history This avoids an unnecessary step to display the revision history. --- .../src/components/global-styles/ui.js | 48 +++---------------- 1 file changed, 7 insertions(+), 41 deletions(-) diff --git a/packages/edit-site/src/components/global-styles/ui.js b/packages/edit-site/src/components/global-styles/ui.js index d2e0d2c302706..7f5535897b5ca 100644 --- a/packages/edit-site/src/components/global-styles/ui.js +++ b/packages/edit-site/src/components/global-styles/ui.js @@ -1,7 +1,6 @@ /** * External dependencies */ -import classnames from 'classnames'; /** * WordPress dependencies @@ -99,18 +98,6 @@ function GlobalStylesActionMenu() { ); } -function RevisionsCountBadge( { className, children } ) { - return ( - - { children } - - ); -} function GlobalStylesRevisionsMenu() { const { setIsListViewOpened } = useDispatch( editSiteStore ); const { revisionsCount } = useSelect( ( select ) => { @@ -128,7 +115,7 @@ function GlobalStylesRevisionsMenu() { }; }, [] ); const { useGlobalStylesReset } = unlock( blockEditorPrivateApis ); - const [ canReset, onReset ] = useGlobalStylesReset(); + const [ canReset ] = useGlobalStylesReset(); const { goTo } = useNavigator(); const { setEditorCanvasContainerView } = unlock( useDispatch( editSiteStore ) @@ -143,33 +130,12 @@ function GlobalStylesRevisionsMenu() { return ( { canReset || hasRevisions ? ( - - { ( { onClose } ) => ( - - { hasRevisions && ( - - { revisionsCount } - - } - > - { __( 'Revision history' ) } - - ) } - { - onReset(); - onClose(); - } } - disabled={ ! canReset } - > - { __( 'Reset to defaults' ) } - - - ) } - +