diff --git a/pwa/src/hooks/useEnvironment.ts b/pwa/src/hooks/useEnvironment.ts index 111a0b10..1b370981 100644 --- a/pwa/src/hooks/useEnvironment.ts +++ b/pwa/src/hooks/useEnvironment.ts @@ -24,7 +24,12 @@ export const useEnvironment = () => { const initiateFromEnv = () => { window.sessionStorage.setItem("SHOW_THEME_SWITCHER", process.env.GATSBY_SHOW_THEME_SWITCHER ?? ""); - window.sessionStorage.setItem("API_BASE_URL", process.env.GATSBY_API_BASE_URL ?? ""); + window.sessionStorage.setItem( + "API_BASE_URL", + process.env.GATSBY_DEV_ENVIRONMENT === "true" + ? "https://api.gateway.commonground.nu/api" + : process.env.GATSBY_API_BASE_URL ?? "", + ); window.sessionStorage.setItem("NL_DESIGN_THEME_CLASSNAME", process.env.GATSBY_NL_DESIGN_THEME_CLASSNAME ?? ""); window.sessionStorage.setItem("FAVICON_URL", process.env.GATSBY_FAVICON_URL ?? ""); window.sessionStorage.setItem("ORGANISATION_NAME", process.env.GATSBY_ORGANISATION_NAME ?? ""); @@ -43,7 +48,12 @@ export const useEnvironment = () => { if (!config) return; // no config found, nothing else to do window.sessionStorage.setItem("SHOW_THEME_SWITCHER", config.GATSBY_SHOW_THEME_SWITCHER ?? ""); - window.sessionStorage.setItem("API_BASE_URL", config.GATSBY_API_BASE_URL ?? ""); + window.sessionStorage.setItem( + "API_BASE_URL", + process.env.GATSBY_DEV_ENVIRONMENT === "true" + ? "https://api.gateway.commonground.nu/api" + : config.GATSBY_API_BASE_URL ?? "", + ); window.sessionStorage.setItem("NL_DESIGN_THEME_CLASSNAME", config.GATSBY_NL_DESIGN_THEME_CLASSNAME ?? ""); window.sessionStorage.setItem("FAVICON_URL", config.GATSBY_FAVICON_URL ?? ""); window.sessionStorage.setItem("ORGANISATION_NAME", config.GATSBY_ORGANISATION_NAME ?? ""); diff --git a/pwa/src/templates/templateParts/themeSwitcherTopBar/ThemeSwitcherTopBar.tsx b/pwa/src/templates/templateParts/themeSwitcherTopBar/ThemeSwitcherTopBar.tsx index e9fdf969..2d3df37f 100644 --- a/pwa/src/templates/templateParts/themeSwitcherTopBar/ThemeSwitcherTopBar.tsx +++ b/pwa/src/templates/templateParts/themeSwitcherTopBar/ThemeSwitcherTopBar.tsx @@ -38,28 +38,28 @@ export const ThemeSwitcherTopBar: React.FC = () => { initiateFromJSON(watchTheme.value); }, [watchTheme]); - if (window.sessionStorage.getItem("SHOW_THEME_SWITCHER") === "false") { - return <>; - } + if (window.sessionStorage.getItem("SHOW_THEME_SWITCHER") === "true") { + return ( +
+
+ Koophulpje - return ( -
-
- Koophulpje + Bekijk de Woo-berichten van verschillende gemeenten +
- Bekijk de Woo-berichten van verschillende gemeenten -
+
+ Selecteer een gemeente -
- Selecteer een gemeente + +
+
+ ); + } - - - - ); + return <>; }; diff --git a/pwa/static/.env.development b/pwa/static/.env.development index 1d253f00..88b72b08 100644 --- a/pwa/static/.env.development +++ b/pwa/static/.env.development @@ -7,10 +7,14 @@ USE_GITHUB_REPOSITORY_NAME_AS_PATH_PREFIX="true" GATSBY_API_BASE_URL=https://api.gateway.commonground.nu/api GATSBY_NL_DESIGN_THEME_CLASSNAME=conduction-theme +# Always uses Development Gateway +GATSBY_DEV_ENVIRONMENT="true" + + # Header GATSBY_FAVICON_URL="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICAgICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgICAgd2lkdGg9IjcxLjAwMDAwMHB0IiBoZWlnaHQ9IjcwLjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgNzEuMDAwMDAwIDc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Cg==" -#Jumbotron +# Jumbotron GATSBY_ORGANISATION_NAME=Conduction GATSBY_JUMBOTRON_IMAGE_URL=https://www.conduction.nl/wp-content/uploads/2021/07/cropped-Conduction_HOME_0000_afb1-1.png diff --git a/pwa/static/.env.production b/pwa/static/.env.production index 2ff04b18..3660e063 100644 --- a/pwa/static/.env.production +++ b/pwa/static/.env.production @@ -7,6 +7,9 @@ USE_GITHUB_REPOSITORY_NAME_AS_PATH_PREFIX= GATSBY_API_BASE_URL= GATSBY_NL_DESIGN_THEME_CLASSNAME= +# Always uses Development Gateway +GATSBY_DEV_ENVIRONMENT= + # Header GATSBY_FAVICON_URL= @@ -18,5 +21,14 @@ GATSBY_JUMBOTRON_IMAGE_URL= GATSBY_FOOTER_LOGO_HREF= GATSBY_FOOTER_CONTENT= +# options: "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" +GATSBY_FOOTER_CONTENT_HEADER= + #OIDN GATSBY_OIDN_NUMBER= + +#Theme switcher +GATSBY_SHOW_THEME_SWITCHER= + +# Deployment option, if you're using this .env file DO NOT REMOVE OR EDIT THIS +GATSBY_ENV_VARS_SET=