-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds notifications to nav screen (#22326)
- adds a sample notification for saving menus - fixes a empty menu items crashing the menu page
- Loading branch information
1 parent
ed46a29
commit 91a8966
Showing
6 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { useSelect, useDispatch } from '@wordpress/data'; | ||
import { SnackbarList } from '@wordpress/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="edit-navigation-notices" | ||
notices={ notices } | ||
onRemove={ removeNotice } | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.components-snackbar-list.edit-navigation-notices { | ||
position: fixed; | ||
bottom: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters