Skip to content
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
37 changes: 25 additions & 12 deletions src/common-components/NotFoundPage.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
import { FormattedMessage } from '@openedx/frontend-base';
import { FormattedMessage, getSiteConfig, useIntl } from '@openedx/frontend-base';
import { Helmet } from 'react-helmet';

const NotFoundPage = () => (
<div className="container-fluid d-flex py-5 justify-content-center align-items-start text-center">
<p className="my-0 py-5 text-muted mw-32em">
<FormattedMessage
id="error.notfound.message"
defaultMessage="The page you're looking for is unavailable or there's an error in the URL. Please check the URL and try again."
description="error message when a page does not exist"
/>
</p>
</div>
);
import messages from './messages';

const NotFoundPage = () => {
const { formatMessage } = useIntl();
return (
<div className="container-fluid d-flex py-5 justify-content-center align-items-start text-center">
<Helmet>
<title>
{formatMessage(messages['error.notfound.page.title'], {
siteName: getSiteConfig().siteName,
})}
</title>
</Helmet>
<p className="my-0 py-5 text-muted mw-32em">
<FormattedMessage
id="error.notfound.message"
defaultMessage="The page you're looking for is unavailable or there's an error in the URL. Please check the URL and try again."
description="error message when a page does not exist"
/>
</p>
</div>
);
};

export default NotFoundPage;
6 changes: 6 additions & 0 deletions src/common-components/messages.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { defineMessages } from '@openedx/frontend-base';

const messages = defineMessages({
// not found page
'error.notfound.page.title': {
id: 'error.notfound.page.title',
defaultMessage: 'Page Not Found | {siteName}',
description: 'Document title for the page-not-found page',
},
// institution login strings
'institution.login.page.sub.heading': {
id: 'institution.login.page.sub.heading',
Expand Down
Loading