diff --git a/packages/edit-widgets/src/components/notices/index.js b/packages/edit-widgets/src/components/notices/index.js index 0e15bbf8a15bf..dcd366033985f 100644 --- a/packages/edit-widgets/src/components/notices/index.js +++ b/packages/edit-widgets/src/components/notices/index.js @@ -6,27 +6,47 @@ import { filter } from 'lodash'; /** * WordPress dependencies */ -import { SnackbarList } from '@wordpress/components'; +import { NoticeList, SnackbarList } from '@wordpress/components'; import { useSelect, useDispatch } from '@wordpress/data'; import { store as noticesStore } from '@wordpress/notices'; function Notices() { + const { removeNotice } = useDispatch( noticesStore ); const { notices } = useSelect( ( select ) => { return { notices: select( noticesStore ).getNotices(), }; }, [] ); + + const dismissibleNotices = filter( notices, { + isDismissible: true, + type: 'default', + } ); + const nonDismissibleNotices = filter( notices, { + isDismissible: false, + type: 'default', + } ); const snackbarNotices = filter( notices, { type: 'snackbar', } ); - const { removeNotice } = useDispatch( noticesStore ); return ( - + <> + + + + ); } diff --git a/packages/edit-widgets/src/components/notices/style.scss b/packages/edit-widgets/src/components/notices/style.scss index c71d8a34487cc..c0b1f01836fd3 100644 --- a/packages/edit-widgets/src/components/notices/style.scss +++ b/packages/edit-widgets/src/components/notices/style.scss @@ -6,3 +6,21 @@ padding-right: 16px; } @include editor-left(".edit-widgets-notices__snackbar"); + +.edit-widgets-notices__dismissible, +.edit-widgets-notices__pinned { + .components-notice { + box-sizing: border-box; + margin: 0; + border-bottom: $border-width solid rgba(0, 0, 0, 0.2); + padding: 0 $grid-unit-15; + + // Min-height matches the height of a single-line notice with an action button. + min-height: $header-height; + + // Margins ensure that the dismiss button aligns to the center of the first line of text. + .components-notice__dismiss { + margin-top: $grid-unit-15; + } + } +}