show/hde map with env variable
This commit is contained in:
@@ -31,7 +31,7 @@ import {
|
|||||||
} from "../../store/watchedCases/action";
|
} from "../../store/watchedCases/action";
|
||||||
|
|
||||||
const Home = (props) => {
|
const Home = (props) => {
|
||||||
const { footerLinks, pages, watchedCases } = props;
|
const { footerLinks, pages, watchedCases, showMap } = props;
|
||||||
let { t, lang } = useTranslation();
|
let { t, lang } = useTranslation();
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -112,6 +112,7 @@ const Home = (props) => {
|
|||||||
<div className="govuk-width-container">
|
<div className="govuk-width-container">
|
||||||
<Breadcrumbs slug={appealtypes} />
|
<Breadcrumbs slug={appealtypes} />
|
||||||
<DNSSearchResults
|
<DNSSearchResults
|
||||||
|
showMap={showMap}
|
||||||
searchString="DNS"
|
searchString="DNS"
|
||||||
searchResultsObj={props.searchResultsObj}
|
searchResultsObj={props.searchResultsObj}
|
||||||
myportal={true}
|
myportal={true}
|
||||||
@@ -152,6 +153,8 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
}
|
}
|
||||||
: searchResultsObj;
|
: searchResultsObj;
|
||||||
|
|
||||||
|
const showMapCheck = process.env.SHOWMAPS || false;
|
||||||
|
|
||||||
const [searchDetailsObj, watchedCasesDetails] = await Promise.all([
|
const [searchDetailsObj, watchedCasesDetails] = await Promise.all([
|
||||||
await getSearchDetails(searchResultsObj),
|
await getSearchDetails(searchResultsObj),
|
||||||
await getDetails(watchedCases, "myWatchedCases"),
|
await getDetails(watchedCases, "myWatchedCases"),
|
||||||
@@ -163,6 +166,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
|||||||
store.dispatch(setDNSCoords(dnsCoords));
|
store.dispatch(setDNSCoords(dnsCoords));
|
||||||
store.dispatch(setWatchedCases(watchedCases));
|
store.dispatch(setWatchedCases(watchedCases));
|
||||||
store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
|
||||||
|
return {
|
||||||
|
props: { showMap: showMapCheck },
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ const Home = (props) => {
|
|||||||
appealTypeID={
|
appealTypeID={
|
||||||
props.currentView.caseReference.appealType
|
props.currentView.caseReference.appealType
|
||||||
}
|
}
|
||||||
|
showMap={props.currentView.caseReference.showMap}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Footer footerLinks={footerLinks} />
|
<Footer footerLinks={footerLinks} />
|
||||||
|
|||||||
Reference in New Issue
Block a user