CTA.js
5 years ago
CheckboxControl.js
5 years ago
CodeMirror.js
3 years ago
ColorPicker.js
5 years ago
ComboboxControl.js
3 years ago
Disabled.js
5 years ago
Fields.js
5 years ago
Group.js
3 years ago
Groups.js
5 years ago
Integration.js
5 years ago
Loading.js
5 years ago
Media.js
3 years ago
Notices.js
3 years ago
NullView.js
5 years ago
Page.js
5 years ago
SaveButton.js
3 years ago
SelectControl.js
5 years ago
TextControl.js
5 years ago
ToggleControl.js
5 years ago
Notices.js
19 lines
| 1 | import { SnackbarList } from "@wordpress/components"; |
| 2 | import { useDispatch, useSelect } from "@wordpress/data"; |
| 3 | |
| 4 | import { store as noticesStore } from "@wordpress/notices"; |
| 5 | |
| 6 | export default ({ className }) => { |
| 7 | const notices = useSelect((select) => select(noticesStore).getNotices()); |
| 8 | const { removeNotice } = useDispatch(noticesStore); |
| 9 | const snackbarNotices = notices.filter(({ type }) => type === "snackbar"); |
| 10 | |
| 11 | return ( |
| 12 | <SnackbarList |
| 13 | notices={snackbarNotices} |
| 14 | className={className} |
| 15 | onRemove={removeNotice} |
| 16 | /> |
| 17 | ); |
| 18 | }; |
| 19 |