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

feat: rimosso link a form contatto, aggiunto link a motore di ricerca del sito #269

Merged
merged 2 commits into from
Aug 4, 2023
Merged
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
77 changes: 77 additions & 0 deletions src/customizations/volto/components/theme/NotFound/NotFound.jsx
mamico marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
CUSTOMIZATIONS:
- Removed the "Site Administration" link, added a link to the search 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);

useEffect(() => {
dispatch(
getNavigation(
config.settings.isMultilingual ? `/${toBackendLang(lang)}` : '/',
config.settings.navDepth,
),
);
}, [dispatch, lang]);

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="/search">
<FormattedMessage id="Search Site" defaultMessage="Search Site" />
</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);