-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
37 additions
and
36 deletions.
There are no files selected for viewing
34 changes: 0 additions & 34 deletions
34
packages/edit-site/src/components/header/close-area/index.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/edit-site/src/components/header/main-dashboard-button/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { isEmpty } from 'lodash'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { createSlotFill } from '@wordpress/components'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import FullscreenModeClose from '../fullscreen-mode-close'; | ||
|
||
const { Fill: MainDashboardButton, Slot } = createSlotFill( | ||
'SiteEditorMainDashboardButton' | ||
); | ||
|
||
MainDashboardButton.Slot = () => ( | ||
<Slot> | ||
{ ( fills ) => { | ||
// Return default Close button if no fills are provided, otherwise replace it with available fills. | ||
if ( isEmpty( fills ) ) { | ||
return <FullscreenModeClose />; | ||
} | ||
|
||
return <> { fills } </>; | ||
} } | ||
</Slot> | ||
); | ||
|
||
export default MainDashboardButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters