From 04c7c760dc480ae2d2eae295ca5bab6c766d31a9 Mon Sep 17 00:00:00 2001 From: Grant Kinney Date: Fri, 30 Apr 2021 08:07:49 -0500 Subject: [PATCH] Site Editor: use EditorNotices component for notices (#31303) --- .../edit-site/src/components/editor/index.js | 5 ++-- .../src/components/editor/style.scss | 10 ++++++++ .../edit-site/src/components/notices/index.js | 24 ------------------- .../src/components/notices/style.scss | 9 ------- packages/edit-site/src/style.scss | 1 - 5 files changed, 13 insertions(+), 36 deletions(-) delete mode 100644 packages/edit-site/src/components/notices/index.js delete mode 100644 packages/edit-site/src/components/notices/style.scss diff --git a/packages/edit-site/src/components/editor/index.js b/packages/edit-site/src/components/editor/index.js index bb81ddfde978df..2ff1f9e846a71f 100644 --- a/packages/edit-site/src/components/editor/index.js +++ b/packages/edit-site/src/components/editor/index.js @@ -13,16 +13,17 @@ import { store as interfaceStore, } from '@wordpress/interface'; import { + EditorNotices, EntitiesSavedStates, UnsavedChangesWarning, store as editorStore, } from '@wordpress/editor'; import { __ } from '@wordpress/i18n'; import { PluginArea } from '@wordpress/plugins'; + /** * Internal dependencies */ -import Notices from '../notices'; import Header from '../header'; import { SidebarComplementaryAreaFills } from '../sidebar'; import BlockEditor from '../block-editor'; @@ -209,7 +210,7 @@ function Editor( { initialSettings } ) { } content={ <> - + { template && ( - select( noticesStore ) - .getNotices() - .filter( ( notice ) => notice.type === 'snackbar' ), - [] - ); - const { removeNotice } = useDispatch( noticesStore ); - return ( - - ); -} diff --git a/packages/edit-site/src/components/notices/style.scss b/packages/edit-site/src/components/notices/style.scss deleted file mode 100644 index ff39512b005186..00000000000000 --- a/packages/edit-site/src/components/notices/style.scss +++ /dev/null @@ -1,9 +0,0 @@ -.edit-site-notices { - bottom: 20px; - padding-left: 16px; - padding-right: 16px; - position: fixed; - right: 0; -} - -@include editor-left(".edit-site-notices"); diff --git a/packages/edit-site/src/style.scss b/packages/edit-site/src/style.scss index 42894cd6e4ecf4..846e1673d65578 100644 --- a/packages/edit-site/src/style.scss +++ b/packages/edit-site/src/style.scss @@ -6,7 +6,6 @@ @import "./components/header/more-menu/style.scss"; @import "./components/navigation-sidebar/navigation-toggle/style.scss"; @import "./components/navigation-sidebar/navigation-panel/style.scss"; -@import "./components/notices/style.scss"; @import "./components/sidebar/style.scss"; @import "./components/sidebar/settings-header/style.scss"; @import "./components/sidebar/template-card/style.scss";