Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance 404 message styling #69234

Merged
merged 6 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions packages/edit-site/src/components/layout/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,6 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
}
}

.edit-site-layout__area__404 {
margin: $canvas-padding;
}

.edit-site .components-editor-notices__snackbar {
position: fixed;
right: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ export default function SidebarNavigationScreen( {
</HStack>
<div className="edit-site-sidebar-navigation-screen__content">
{ description && (
<p className="edit-site-sidebar-navigation-screen__description">
<div className="edit-site-sidebar-navigation-screen__description">
{ description }
</p>
</div>
) }
{ content }
</div>
Expand Down
19 changes: 15 additions & 4 deletions packages/edit-site/src/components/site-editor-routes/notfound.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,33 @@ import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import { Notice, __experimentalSpacer as Spacer } from '@wordpress/components';
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';

function NotFoundError() {
return (
<Notice status="error" isDismissible={ false }>
{ __(
'The requested page could not be found. Please check the URL.'
) }
</Notice>
);
}

export const notFoundRoute = {
name: 'notfound',
path: '*',
areas: {
sidebar: <SidebarNavigationScreenMain />,
mobile: (
<SidebarNavigationScreenMain
customDescription={ __( '404 (Not Found)' ) }
customDescription={ <NotFoundError /> }
/>
),
content: (
<p className="edit-site-layout__area__404">
{ __( '404 (Not Found)' ) }
</p>
<Spacer padding={ 2 }>
<NotFoundError />
</Spacer>
),
},
};
Loading