Skip to content

Commit

Permalink
Rebase and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Nov 18, 2021
1 parent 84878b5 commit 28e7eb3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 53 deletions.
12 changes: 1 addition & 11 deletions packages/edit-site/src/components/editor/index.js
Expand Up @@ -36,7 +36,6 @@ import { SidebarComplementaryAreaFills } from '../sidebar';
import NavigationSidebar from '../navigation-sidebar';
import BlockEditor from '../block-editor';
import KeyboardShortcuts from '../keyboard-shortcuts';
import NavigationSidebar from '../navigation-sidebar';
import URLQueryController from '../url-query-controller';
import InserterSidebar from '../secondary-sidebar/inserter-sidebar';
import ListViewSidebar from '../secondary-sidebar/list-view-sidebar';
Expand Down Expand Up @@ -114,11 +113,7 @@ function Editor( { initialSettings, onError } ) {
// so that they can be selected with core/editor selectors in any editor.
// This is needed because edit-site doesn't initialize with EditorProvider,
// which internally uses updateEditorSettings as well.
const {
defaultTemplateTypes,
defaultTemplatePartAreas,
__experimentalNewMenuSidebar: newMenuSidebar,
} = settings;
const { defaultTemplateTypes, defaultTemplatePartAreas } = settings;
useEffect( () => {
updateEditorSettings( {
defaultTemplateTypes,
Expand Down Expand Up @@ -220,11 +215,6 @@ function Editor( { initialSettings, onError } ) {
<SidebarComplementaryAreaFills />
<InterfaceSkeleton
labels={ interfaceLabels }
drawer={
newMenuSidebar ? undefined : (
<NavigationSidebar />
)
}
secondarySidebar={ secondarySidebar() }
sidebar={
sidebarIsOpened && (
Expand Down
9 changes: 0 additions & 9 deletions packages/edit-site/src/components/header/index.js
Expand Up @@ -45,15 +45,13 @@ export default function Header( {
isListViewOpen,
listViewShortcut,
isLoaded,
newMenuSidebar,
} = useSelect( ( select ) => {
const {
__experimentalGetPreviewDeviceType,
getEditedPostType,
getEditedPostId,
isInserterOpened,
isListViewOpened,
getSettings,
} = select( editSiteStore );
const { getEditedEntityRecord } = select( coreStore );
const { __experimentalGetTemplateInfo: getTemplateInfo } = select(
Expand All @@ -77,7 +75,6 @@ export default function Header( {
listViewShortcut: getShortcutRepresentation(
'core/edit-site/toggle-list-view'
),
newMenuSidebar: getSettings().__experimentalNewMenuSidebar,
};
}, [] );

Expand Down Expand Up @@ -108,12 +105,6 @@ export default function Header( {
return (
<div className="edit-site-header">
<div className="edit-site-header_start">
{ newMenuSidebar && (
<MainDashboardButton.Slot>
<NavigationLink />
</MainDashboardButton.Slot>
) }

<div className="edit-site-header__toolbar">
<Button
ref={ inserterButton }
Expand Down
36 changes: 6 additions & 30 deletions packages/edit-site/src/components/template-details/index.js
Expand Up @@ -31,13 +31,7 @@ export default function TemplateDetails( { template, onClose } ) {
select( editorStore ).__experimentalGetTemplateInfo( template ),
[]
);
const newMenuSidebar = useSelect(
( select ) =>
select( editSiteStore ).getSettings().__experimentalNewMenuSidebar
);
const { openNavigationPanelToMenu, revertTemplate } = useDispatch(
editSiteStore
);
const { revertTemplate } = useDispatch( editSiteStore );

const templateSubMenu = useMemo( () => {
if ( template?.type === 'wp_template' ) {
Expand All @@ -53,11 +47,6 @@ export default function TemplateDetails( { template, onClose } ) {
return null;
}

const showTemplateInSidebar = () => {
onClose();
openNavigationPanelToMenu( templateSubMenu.menu );
};

const revert = () => {
revertTemplate( template );
onClose();
Expand Down Expand Up @@ -101,24 +90,11 @@ export default function TemplateDetails( { template, onClose } ) {

<Button
className="edit-site-template-details__show-all-button"
{ ...( newMenuSidebar
? {
href: addQueryArgs( 'edit.php', {
page: 'gutenberg-edit-site',
// TODO: We should update this to filter by template part's areas as well.
post_type: template.type,
} ),
}
: {
onClick: showTemplateInSidebar,
'aria-label': sprintf(
/* translators: %1$s: the template part's area name ("Headers", "Sidebars") or "templates". */
__(
'Browse all %1$s. This will open the %1$s menu in the navigation side panel.'
),
templateSubMenu.title
),
} ) }
href={ addQueryArgs( '', {
page: 'gutenberg-edit-site',
// TODO: We should update this to filter by template part's areas as well.
postType: template.type,
} ) }
>
{ sprintf(
/* translators: the template part's area name ("Headers", "Sidebars") or "templates". */
Expand Down
2 changes: 0 additions & 2 deletions packages/edit-site/src/index.js
Expand Up @@ -50,8 +50,6 @@ export function initializeEditor( id, settings ) {
fetchLinkSuggestions( search, searchOptions, settings );
settings.__experimentalFetchRichUrlData = fetchUrlData;
settings.__experimentalSpotlightEntityBlocks = [ 'core/template-part' ];
// Feature flag for the new menu sidebar which isn't stable yet.
settings.__experimentalNewMenuSidebar = false;

const target = document.getElementById( id );
const reboot = reinitializeEditor.bind( null, target, settings );
Expand Down
1 change: 0 additions & 1 deletion packages/edit-site/src/style.scss
Expand Up @@ -5,7 +5,6 @@
@import "./components/header/style.scss";
@import "./components/header/document-actions/style.scss";
@import "./components/header/more-menu/style.scss";
@import "./components/header/navigation-link/style.scss";
@import "./components/navigation-sidebar/navigation-toggle/style.scss";
@import "./components/navigation-sidebar/navigation-panel/style.scss";
@import "./components/list/style.scss";
Expand Down

0 comments on commit 28e7eb3

Please sign in to comment.