Skip to content

Commit

Permalink
Add inserter to the edit site screen (#21328)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Apr 1, 2020
1 parent 17e1d10 commit f322b44
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/edit-site/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
* WordPress dependencies
*/
import { useCallback } from '@wordpress/element';
import { BlockNavigationDropdown, ToolSelector } from '@wordpress/block-editor';
import {
BlockNavigationDropdown,
ToolSelector,
Inserter,
} from '@wordpress/block-editor';
import { PinnedItems } from '@wordpress/interface';

/**
Expand All @@ -14,6 +18,8 @@ import MoreMenu from './more-menu';
import TemplateSwitcher from '../template-switcher';
import SaveButton from '../save-button';

const inserterToggleProps = { isPrimary: true };

export default function Header() {
const { settings, setSettings } = useEditorContext();
const setActiveTemplateId = useCallback(
Expand Down Expand Up @@ -47,6 +53,11 @@ export default function Header() {
<div className="edit-site-header">
<FullscreenModeClose />
<div className="edit-site-header__toolbar">
<Inserter
position="bottom right"
showInserterHelpPanel
toggleProps={ inserterToggleProps }
/>
<TemplateSwitcher
ids={ settings.templateIds }
templatePartIds={ settings.templatePartIds }
Expand Down
1 change: 1 addition & 0 deletions packages/edit-site/src/components/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
.edit-site-header__toolbar {
display: flex;
flex-grow: 1;
padding-left: $grid-unit-10;

& > * {
margin-left: 5px;
Expand Down

0 comments on commit f322b44

Please sign in to comment.