/** * WordPress dependencies */ const { useSelect, useDispatch } = wp.data; const { SnackbarList } = wp.components; export default function Notices() { const notices = useSelect( ( select ) => select( 'core/notices' ) .getNotices() .filter( ( notice ) => notice.type === 'snackbar' ), [] ); const { removeNotice } = useDispatch( 'core/notices' ); return ( <SnackbarList className="components-editor-notices__snackbar" notices={ notices } onRemove={ removeNotice } /> ); }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
changelog-item.js | File | 958 B | 0644 |
|
changelog.js | File | 2.29 KB | 0644 |
|
customizer.js | File | 2.21 KB | 0644 |
|
dash-controls.scss | File | 5.78 KB | 0644 |
|
help.js | File | 1.15 KB | 0644 |
|
index.js | File | 3.23 KB | 0644 |
|
notices.js | File | 508 B | 0644 |
|
pro-extension.js | File | 3.11 KB | 0644 |
|
recomended.js | File | 290 B | 0644 |
|
sidebar.js | File | 1.22 KB | 0644 |
|
starter.js | File | 2.15 KB | 0644 |
|