2019-11-22 14:02:55 +00:00
|
|
|
import React from "react";
|
2020-12-17 07:03:59 +00:00
|
|
|
import { connect } from "react-redux";
|
2020-07-08 10:14:03 +00:00
|
|
|
import styled from "styled-components";
|
|
|
|
|
import Button from "components/editorComponents/Button";
|
|
|
|
|
import PageUnavailableImage from "assets/images/404-image.png";
|
2020-08-03 14:18:48 +00:00
|
|
|
import { APPLICATIONS_URL } from "constants/routes";
|
2020-12-17 07:03:59 +00:00
|
|
|
import { flushErrorsAndRedirect } from "actions/errorActions";
|
2019-02-07 05:07:09 +00:00
|
|
|
|
2020-07-08 10:14:03 +00:00
|
|
|
const Wrapper = styled.div`
|
2019-11-22 14:02:55 +00:00
|
|
|
text-align: center;
|
2020-07-08 10:14:03 +00:00
|
|
|
margin-top: 5%;
|
|
|
|
|
.bold-text {
|
2020-12-24 04:32:25 +00:00
|
|
|
font-weight: ${(props) => props.theme.fontWeights[3]};
|
2020-07-08 10:14:03 +00:00
|
|
|
font-size: 24px;
|
|
|
|
|
}
|
|
|
|
|
.page-unavailable-img {
|
|
|
|
|
width: 35%;
|
|
|
|
|
}
|
|
|
|
|
.button-position {
|
|
|
|
|
margin: auto;
|
|
|
|
|
}
|
2019-11-22 14:02:55 +00:00
|
|
|
`;
|
2020-07-08 10:14:03 +00:00
|
|
|
|
2020-12-17 07:03:59 +00:00
|
|
|
interface Props {
|
|
|
|
|
flushErrorsAndRedirect?: any;
|
2019-02-07 05:07:09 +00:00
|
|
|
}
|
2020-12-17 07:03:59 +00:00
|
|
|
const PageNotFound: React.FC<Props> = (props: Props) => {
|
|
|
|
|
const { flushErrorsAndRedirect } = props;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Wrapper>
|
|
|
|
|
<img
|
|
|
|
|
src={PageUnavailableImage}
|
|
|
|
|
alt="Page Unavailable"
|
|
|
|
|
className="page-unavailable-img"
|
|
|
|
|
/>
|
|
|
|
|
<div>
|
|
|
|
|
<p className="bold-text">Page not found</p>
|
|
|
|
|
<p>
|
|
|
|
|
Either this page doesn't exist, or you don't have access to{" "}
|
|
|
|
|
<br />
|
|
|
|
|
this page.
|
|
|
|
|
</p>
|
|
|
|
|
<Button
|
|
|
|
|
filled
|
|
|
|
|
text="Go back to homepage"
|
|
|
|
|
intent="primary"
|
|
|
|
|
icon="arrow-right"
|
|
|
|
|
iconAlignment="right"
|
|
|
|
|
size="small"
|
|
|
|
|
className="button-position"
|
|
|
|
|
onClick={() => flushErrorsAndRedirect(APPLICATIONS_URL)}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</Wrapper>
|
|
|
|
|
);
|
|
|
|
|
};
|
2019-02-07 05:07:09 +00:00
|
|
|
|
2020-12-17 07:03:59 +00:00
|
|
|
export default connect(null, {
|
|
|
|
|
flushErrorsAndRedirect,
|
|
|
|
|
})(PageNotFound);
|