forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Site Editor should display a 404 message (WordPress#69009)
Add a 404 message to the Site Editor. Add a new "notfound" route to the site editor routes. Pass a custom description to SidebarNavigationScreenMain, to display the 404 message on smaller screen widths. Co-authored-by: carolinan <[email protected]> Co-authored-by: Mamaduka <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: t-hamano <[email protected]>
- Loading branch information
1 parent
fe2195e
commit 0740acc
Showing
4 changed files
with
48 additions
and
10 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
27 changes: 27 additions & 0 deletions
27
packages/edit-site/src/components/site-editor-routes/notfound.js
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,27 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main'; | ||
|
||
export const notFoundRoute = { | ||
name: 'notfound', | ||
path: '*', | ||
areas: { | ||
sidebar: <SidebarNavigationScreenMain />, | ||
mobile: ( | ||
<SidebarNavigationScreenMain | ||
customDescription={ __( '404 (Not Found)' ) } | ||
/> | ||
), | ||
content: ( | ||
<p className="edit-site-layout__area__404"> | ||
{ __( '404 (Not Found)' ) } | ||
</p> | ||
), | ||
}, | ||
}; |