added mock call for case view

This commit is contained in:
2021-08-02 16:29:13 +01:00
parent 9bbd0aa741
commit 7ce4460b47
24 changed files with 1135 additions and 267 deletions
+33 -35
View File
@@ -35,8 +35,23 @@ const Home = (props) => {
<Header courseName={t("common:service-name")} />
<div className="govuk-width-container">
<Banner />
<Breadcrumbs slug={appealtypes} />
<Case />
<Breadcrumbs slug={appealtypes} props={props} />
<Case
myCases={props.myCases.myCases}
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>
@@ -44,38 +59,21 @@ const Home = (props) => {
);
};
// export const getServerSideProps = wrapper.getServerSideProps(
// async ({ locale, store, req, res }) => {
// const token = await getToken();
// let accessToken = token.access_token;
const mapStateToProps = (state) => {
//console.log(state);
// const apiRoot = process.browser ? window.API_ROOT : process.env.API_ROOT;
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,
};
};
// const [pages, footerLinks, courseListContent] = await Promise.all([
// await getPages(accessToken, locale),
// await getFooterLinks(accessToken, locale),
// await getCourseList(accessToken, locale),
// ]);
// //const courseID = await getCourseID
// store.dispatch(setApiRoot(apiRoot));
// store.dispatch(setPages(pages));
// store.dispatch(setFooterLinks(footerLinks));
// store.dispatch(setCourseListContent(courseListContent));
// }
// );
// const mapStateToProps = (state) => {
// //console.log(state);
// return {
// apiroot: state.apiroot,
// courseListContent: state.courseListContent.courseListContent,
// pages: state.pages.pages,
// footerLinks: state.footerLinks.footerLinks,
// regions: state.regions,
// sectors: state.sectors,
// form: state.form,
// };
// };
export default Home; //connect(mapStateToProps)(Home);
export default connect(mapStateToProps)(Home);