design-comuni-plone-theme
Version:
Volto Theme for Italia design guidelines
77 lines (70 loc) • 2.71 kB
JSX
/*
CUSTOMIZATIONS:
- Removed the "Site Administration" link, added a link to the home page
*/
import { useEffect } from 'react';
import { BodyClass, toBackendLang } from '@plone/volto/helpers';
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router-dom';
import { Container } from 'semantic-ui-react';
import { withServerErrorCode } from '@plone/volto/helpers/Utils/Utils';
import { useDispatch, useSelector } from 'react-redux';
import { getNavigation } from '@plone/volto/actions';
import config from '@plone/volto/registry';
/**
* Not found function.
* @function NotFound
* @returns {string} Markup of the not found page.
*/
const NotFound = () => {
const dispatch = useDispatch();
const lang = useSelector((state) => state.intl.locale);
const navigationRootPath = config.settings.isMultilingual
? `/${toBackendLang(lang)}`
: '/';
useEffect(() => {
dispatch(getNavigation(navigationRootPath, config.settings.navDepth));
}, [dispatch, lang, navigationRootPath]);
return (
<Container className="view-wrapper">
<BodyClass className="page-not-found" />
<h1>
<FormattedMessage
id="This page does not seem to exist…"
defaultMessage="This page does not seem to exist…"
/>
</h1>
<p className="description">
<FormattedMessage
id="We apologize for the inconvenience, but the page you were trying to access is not at this address. You can use the links below to help you find what you are looking for."
defaultMessage="We apologize for the inconvenience, but the page you were trying to access is not at this address. You can use the links below to help you find what you are looking for."
/>
</p>
<p>
<Link to={navigationRootPath}>
<FormattedMessage id="Home page" defaultMessage="Home page" />
</Link>
</p>
{/* <p>
<FormattedMessage
id="If you are certain you have the correct web address but are encountering an error, please contact the {site_admin}."
defaultMessage="If you are certain you have the correct web address but are encountering an error, please contact the {site_admin}."
values={{
site_admin: (
<Link to="/contact-form">
<FormattedMessage
id="Site Administration"
defaultMessage="Site Administration"
/>
</Link>
),
}}
/>
</p> */}
<p>
<FormattedMessage id="Thank you." defaultMessage="Thank you." />
</p>
</Container>
);
};
export default withServerErrorCode(404)(NotFound);