updated the cookies functionality

This commit is contained in:
2021-12-09 13:32:15 +00:00
parent 9c5c35fa4e
commit 0e18aa35b8
18 changed files with 507 additions and 182 deletions
+30 -12
View File
@@ -17,9 +17,10 @@ import jsonpath from "jsonpath";
import { reduxForm, formValueSelector } from "redux-form";
import RegisterForm from "../../components/account/registerform";
import { dehashString, hashAPIPath } from "../../actions";
const Home = (props) => {
const { footerLinks, formData } = props;
const { footerLinks, formData, loggedInUserEmail } = props;
let { t, lang } = useTranslation();
const router = useRouter();
@@ -97,6 +98,9 @@ const Home = (props) => {
setAccountCreatedComplete={
setAccountCreatedComplete
}
loggedInUserEmail={
loggedInUserEmail
}
/>
</div>
{registerFormComplete != true ||
@@ -151,17 +155,31 @@ const Home = (props) => {
);
};
// export const getServerSideProps = wrapper.getServerSideProps(
// (store) =>
// async ({ query, req, res }) => {
// const appealTypeData = await getAppealsTypes();
// const lpaData = await getLPA();
// console.log("appeal types", appealTypeData);
// console.log("lpa typeswwwww", lpaData);
// store.dispatch(setAppealType(appealTypeData));
// store.dispatch(setLPA(lpaData));
// }
// );
export const getServerSideProps = wrapper.getServerSideProps(
(store) =>
async ({ query, req, res }) => {
// const appealTypeData = await getAppealsTypes();
// const lpaData = await getLPA();
// console.log("appeal types", appealTypeData);
// console.log("lpa typeswwwww", lpaData);
// store.dispatch(setAppealType(appealTypeData));
// store.dispatch(setLPA(lpaData));
let hasRegistrationEmail = typeof query.id != "undefined";
let loginEmailStr = "";
if (hasRegistrationEmail == true) {
loginEmailStr = dehashString(query.id);
console.log(loginEmailStr);
}
return {
props: {
loggedInUserEmail: loginEmailStr,
},
};
}
);
const mapStateToProps = (state) => {
return {