83 lines
2.9 KiB
JavaScript
83 lines
2.9 KiB
JavaScript
import _ from "lodash";
|
|
import Head from "next/head";
|
|
import Header from "../components/header";
|
|
import Banner from "../components/banner";
|
|
import CookieBanner from "../components/cookieBanner";
|
|
import Breadcrumbs from "../components/breadcrumbs";
|
|
import CaseSummary from "../components/case";
|
|
import Footer from "../components/footer";
|
|
import Errorpage from "../components/errorpage";
|
|
import styles from "../styles/Home.module.css";
|
|
import { useSelector, shallowEqual, connect } from "react-redux";
|
|
import { wrapper } from "../store/store";
|
|
import Cookies from "cookies";
|
|
import { useRouter } from "next/router";
|
|
import useTranslation from "next-translate/useTranslation";
|
|
import Case from "../components/case";
|
|
|
|
const Home = (props) => {
|
|
const { footerLinks, pages } = props;
|
|
let { t, lang } = useTranslation();
|
|
|
|
const router = useRouter();
|
|
const { locale } = router;
|
|
const { appealtypes } = router.query;
|
|
|
|
return (
|
|
<div>
|
|
<Head>
|
|
<title>
|
|
{t("case:page-title")} - {t("common:service-name")}
|
|
</title>
|
|
</Head>
|
|
<div id="page_wrapper">
|
|
<CookieBanner />
|
|
<Header courseName={t("common:service-name")} />
|
|
<div className="govuk-width-container">
|
|
<Banner />
|
|
<Breadcrumbs slug={appealtypes} props={props} />
|
|
<Case
|
|
myCases={props.myCases.myCases}
|
|
searchResultsObj={
|
|
props.searchResultsObj.searchResultsObj
|
|
}
|
|
myRepresentations={
|
|
props.myRepresentations.myRepresentations
|
|
}
|
|
watchedCases={props.watchedCases.watchedCases}
|
|
awaitingSubmission={
|
|
props.awaitingSubmission.awaitingSubmission
|
|
}
|
|
caseReference={
|
|
props.currentView.caseReference.currentReference
|
|
}
|
|
currentType={
|
|
props.currentView.caseReference.currentType
|
|
}
|
|
/>
|
|
</div>
|
|
<Footer footerLinks={footerLinks} />
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
const mapStateToProps = (state) => {
|
|
//console.log(state);
|
|
|
|
return {
|
|
currentView: state.currentView,
|
|
search: state.search,
|
|
searchResultsObj: state.searchResultsObj,
|
|
formData: state.formData,
|
|
appealType: state.appealType,
|
|
form: state.form,
|
|
myCases: state.myCases,
|
|
watchedCases: state.watchedCases,
|
|
myRepresentations: state.myRepresentations,
|
|
awaitingSubmission: state.awaitingSubmission,
|
|
};
|
|
};
|
|
|
|
export default connect(mapStateToProps)(Home);
|