added environement variable switch for login
This commit is contained in:
+15
-2
@@ -17,7 +17,7 @@ import { getIncidents } from "../actions";
|
||||
import { parseCookies } from "nookies";
|
||||
|
||||
const Home = (props) => {
|
||||
const { footerLinks, pages } = props;
|
||||
const { footerLinks, pages, showLogin } = props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
@@ -78,7 +78,7 @@ const Home = (props) => {
|
||||
<Header courseName="Appeals Casework Portal" />
|
||||
<div className="govuk-width-container">
|
||||
<ServiceBanner />
|
||||
<Main pages={pages} />
|
||||
<Main pages={pages} showLogin={showLogin} />
|
||||
</div>
|
||||
<Footer footerLinks={footerLinks} />
|
||||
</div>
|
||||
@@ -86,4 +86,17 @@ const Home = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const getServerSideProps = wrapper.getServerSideProps(
|
||||
(store) => async (ctx) => {
|
||||
const { query, req, res } = ctx;
|
||||
|
||||
const showLoginCheck = process.env.SHOWLOGIN || false;
|
||||
|
||||
console.log("Show login module: ", showLoginCheck);
|
||||
|
||||
return {
|
||||
props: { showLogin: showLoginCheck },
|
||||
};
|
||||
}
|
||||
);
|
||||
export default Home; //connect(mapStateToProps)(Home);
|
||||
|
||||
Reference in New Issue
Block a user