PluginProbe
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution / 1.3.0
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution v1.3.0
2.0.1 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.9.0 2.0.0
solid-performance / src / Performance / Admin / package / notices.js

notices.js in Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution 1.3.0, at src/Performance/Admin/package/notices.js

36 lines 868 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies
3 */
4 import { useSelect, useDispatch } from '@wordpress/data';
5 import { SnackbarList, NoticeList } from '@wordpress/components';
6
7 export default function Notices() {
8 const notices = useSelect(
9 (select) =>
10 select('core/notices')
11 .getNotices()
12 .filter((notice) => notice.type === 'snackbar'),
13 []
14 );
15 const defaultNotices = useSelect(
16 (select) =>
17 select('core/notices')
18 .getNotices()
19 .filter((notice) => notice.type === 'default'),
20 []
21 );
22 const { removeNotice } = useDispatch('core/notices');
23 return (
24 <>
25 <NoticeList
26 className="components-editor-notices__default"
27 notices={defaultNotices}
28 onRemove={removeNotice}
29 />
30 <div className="swpsp-notice-wrap">
31 <SnackbarList className="components-editor-notices__snackbar" notices={notices} onRemove={removeNotice} />
32 </div>
33 </>
34 );
35 }
36