-
-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into allow-deselect-color-in-ColorPickerWidget
- Loading branch information
Showing
7 changed files
with
70 additions
and
46 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,67 @@ | ||
/** | ||
* Home container. | ||
* @module components/theme/NotFound/NotFound | ||
*/ | ||
|
||
import React from 'react'; | ||
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 = () => ( | ||
<Container className="view-wrapper"> | ||
<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> | ||
<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> | ||
); | ||
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> | ||
<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); |