added logout functions to clear store

This commit is contained in:
2021-07-27 16:29:33 +01:00
parent d55b42a5ab
commit f3fcef69bc
5 changed files with 102 additions and 24 deletions
+13
View File
@@ -0,0 +1,13 @@
// 404.js
import Link from "next/link";
export default function FourOhFour() {
return (
<>
<h1>404 - Page Not Found</h1>
<Link href="/">
<a>Go back home</a>
</Link>
</>
);
}
+50
View File
@@ -0,0 +1,50 @@
import _ from "lodash";
import Link from "next/link";
import Head from "next/head";
import Header from "../components/header";
import Banner from "../components/banner";
import CookieBanner from "../components/cookieBanner";
import Footer from "../components/footer";
import { useSelector, shallowEqual, connect } from "react-redux";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { setLogout } from "../store/accountDetails/action";
const LogOut = (props) => {
const { footerLinks, pages, setLogout } = props;
let { t, lang } = useTranslation();
const router = useRouter();
const { locale } = router;
setLogout();
return (
<div>
<Head>
<title>{t("common:service-name")}</title>
</Head>
<div id="page_wrapper">
<CookieBanner />
<Header courseName="Appeals Casework Portal" />
<div className="govuk-width-container">
<Banner />
<h2>You have been logged out</h2>
<div className="govuk-!-margin-top-9 govuk-!-margin-bottom-9">
<Link href="/">Return to Planning Casework portal</Link>
</div>
</div>
<Footer footerLinks={footerLinks} />
</div>
</div>
);
};
const mapDispatchToProps = (dispatch) => {
return {
setLogout: () => {
dispatch(setLogout());
},
};
};
export default connect(null, mapDispatchToProps)(LogOut);