Skip to content

Commit

Permalink
ADD open-webconcept theme and koophulpje domain routing
Browse files Browse the repository at this point in the history
  • Loading branch information
lencodes committed Nov 21, 2023
1 parent 60778f8 commit d996980
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
4 changes: 3 additions & 1 deletion pwa/src/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ interface LayoutProps {
const Layout: React.FC<LayoutProps> = ({ children, pageContext, location }) => {
const [API, setAPI] = React.useState<APIService>(React.useContext(APIContext));
const [globalContext, setGlobalContext] = React.useState<IGlobalContext>(defaultGlobalContext);
const { initiateFromEnv } = useEnvironment();
const { initiateFromEnv, initiateFromJSON } = useEnvironment();

library.add(fas, fab as IconPack, far as IconPack);

React.useEffect(() => {
if (process.env.GATSBY_ENV_VARS_SET === "true") {
initiateFromEnv();
} else {
initiateFromJSON(window.location.hostname);
}
}, []);

Expand Down
20 changes: 12 additions & 8 deletions pwa/src/services/getConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Dinkelland from "./../../static/configFiles/dinkelland.json";
import Epe from "./../../static/configFiles/epe.json";
import Noaberkracht from "./../../static/configFiles/noaberkracht.json";
import Noordwijk from "./../../static/configFiles/noordwijk.json";
import OpenWebconcept from "./../../static/configFiles/open-webconcept.json";
import Rotterdam from "./../../static/configFiles/rotterdam.json";
import Tubbergen from "./../../static/configFiles/tubbergen.json";
import Xxllnc from "./../../static/configFiles/xxllnc.json";
Expand All @@ -11,27 +12,30 @@ export const getConfig = (themeOrDomainName: string): Record<string, any> | unde
switch (themeOrDomainName) {
case "open.epe.nl":
case "epe-theme":
return Epe as Record<string, any>;
return Epe;
case "open.noordwijk.nl":
case "noordwijk-theme":
return Noordwijk as Record<string, any>;
return Noordwijk;
case "open.rotterdam.nl":
case "rotterdam-theme":
return Rotterdam as Record<string, any>;
return Rotterdam;
case "open.noaberkracht.nl":
case "noaberkracht-theme":
return Noaberkracht as Record<string, any>;
return Noaberkracht;
case "open.tubbergen.nl":
case "tubbergen-theme":
return Tubbergen as Record<string, any>;
return Tubbergen;
case "open.dinkelland.nl":
case "dinkelland-theme":
return Dinkelland as Record<string, any>;
return Dinkelland;
case "open.xxllnc.nl":
case "xxllnc-theme":
return Xxllnc as Record<string, any>;
return Xxllnc;
case "koophulpje.nl":
case "open-webconcept-theme":
return OpenWebconcept;
default:
return Conduction as Record<string, any>;
return Conduction;
}
};

Expand Down
11 changes: 11 additions & 0 deletions pwa/static/configFiles/open-webconcept.json

Large diffs are not rendered by default.

0 comments on commit d996980

Please sign in to comment.