diff --git a/pwa/src/hooks/useEnvironment.ts b/pwa/src/hooks/useEnvironment.ts index 2a16aef2..f465fc48 100644 --- a/pwa/src/hooks/useEnvironment.ts +++ b/pwa/src/hooks/useEnvironment.ts @@ -22,6 +22,7 @@ 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("NL_DESIGN_THEME_CLASSNAME", process.env.GATSBY_NL_DESIGN_THEME_CLASSNAME ?? ""); window.sessionStorage.setItem("FAVICON_URL", process.env.GATSBY_FAVICON_URL ?? ""); @@ -40,6 +41,7 @@ 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("NL_DESIGN_THEME_CLASSNAME", config.GATSBY_NL_DESIGN_THEME_CLASSNAME ?? ""); window.sessionStorage.setItem("FAVICON_URL", config.GATSBY_FAVICON_URL ?? ""); diff --git a/pwa/src/services/getConfig.ts b/pwa/src/services/getConfig.ts index 3d8a9db9..5b2752be 100644 --- a/pwa/src/services/getConfig.ts +++ b/pwa/src/services/getConfig.ts @@ -33,6 +33,7 @@ export const getConfig = (themeOrDomainName: string): Record | unde return Xxllnc; case "koophulpje.nl": case "open-webconcept-theme": + case "localhost": return OpenWebconcept; default: return Conduction; diff --git a/pwa/src/templates/templateParts/themeSwitcherTopBar/ThemeSwitcherTopBar.tsx b/pwa/src/templates/templateParts/themeSwitcherTopBar/ThemeSwitcherTopBar.tsx index 163a0374..e9fdf969 100644 --- a/pwa/src/templates/templateParts/themeSwitcherTopBar/ThemeSwitcherTopBar.tsx +++ b/pwa/src/templates/templateParts/themeSwitcherTopBar/ThemeSwitcherTopBar.tsx @@ -38,6 +38,10 @@ export const ThemeSwitcherTopBar: React.FC = () => { initiateFromJSON(watchTheme.value); }, [watchTheme]); + if (window.sessionStorage.getItem("SHOW_THEME_SWITCHER") === "false") { + return <>; + } + return (
@@ -47,7 +51,7 @@ export const ThemeSwitcherTopBar: React.FC = () => {
- Huidige gemeente + Selecteer een gemeente