diff --git a/packages/edit-site/src/components/header/close-area/index.js b/packages/edit-site/src/components/header/close-area/index.js deleted file mode 100644 index 5371b5d92b859e..00000000000000 --- a/packages/edit-site/src/components/header/close-area/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * External dependencies - */ -import { isEmpty } from 'lodash'; - -/** - * WordPress dependencies - */ -import { createSlotFill } from '@wordpress/components'; - -/** - * Internal dependencies - */ -import FullscreenModeClose from '../fullscreen-mode-close'; - -const { Fill: __experimentalSiteEditorCloseArea, Slot } = createSlotFill( - '__experimentalSiteEditorCloseArea' -); - -__experimentalSiteEditorCloseArea.Slot = () => { - return ( - - { ( fills ) => { - if ( isEmpty( fills ) ) { - return ; - } - - return <> { fills } ; - } } - - ); -}; - -export default __experimentalSiteEditorCloseArea; diff --git a/packages/edit-site/src/components/header/index.js b/packages/edit-site/src/components/header/index.js index 0320a2fbacf3b4..b8c9f5c55753d0 100644 --- a/packages/edit-site/src/components/header/index.js +++ b/packages/edit-site/src/components/header/index.js @@ -15,7 +15,7 @@ import { PinnedItems } from '@wordpress/interface'; * Internal dependencies */ import { useEditorContext } from '../editor'; -import __experimentalSiteEditorCloseArea from './close-area'; +import MainDashboardButton from './main-dashboard-button'; import MoreMenu from './more-menu'; import TemplateSwitcher from '../template-switcher'; import SaveButton from '../save-button'; @@ -62,7 +62,7 @@ export default function Header( { openEntitiesSavedStates } ) { return (
- <__experimentalSiteEditorCloseArea.Slot /> +
( + + { ( fills ) => { + // Return default Close button if no fills are provided, otherwise replace it with available fills. + if ( isEmpty( fills ) ) { + return ; + } + + return <> { fills } ; + } } + +); + +export default MainDashboardButton; diff --git a/packages/edit-site/src/index.js b/packages/edit-site/src/index.js index 1a6bb78d47ad79..c390e2f4c7dd76 100644 --- a/packages/edit-site/src/index.js +++ b/packages/edit-site/src/index.js @@ -28,3 +28,5 @@ export function initialize( id, settings ) { } render( , document.getElementById( id ) ); } + +export { default as MainDashboardButton } from './components/header/main-dashboard-button';