Skip to content

Commit

Permalink
CLEANUP redndant code
Browse files Browse the repository at this point in the history
  • Loading branch information
lencodes committed Nov 14, 2023
1 parent f39688b commit 88de4da
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
6 changes: 3 additions & 3 deletions pwa/src/services/getConfig.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Rotterdam from "./../../static/configFiles/rotterdam.json";
import Epe from "./../../static/configFiles/epe.json";

export const getConfig = (domain: string): Record<string, any> | undefined => {
switch (domain) {
case "localhost":
return Rotterdam as Record<string, any>;
case "open.epe.nl":
return Epe as Record<string, any>;
}
};
15 changes: 0 additions & 15 deletions pwa/src/services/initiateEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,3 @@ export const initiateEnvironment = () => {
window.sessionStorage.setItem("FOOTER_CONTENT_HEADER", config.GATSBY_FOOTER_CONTENT_HEADER ?? "");
window.sessionStorage.setItem("OIDN_NUMBER", config.GATSBY_OIDN_NUMBER ?? "");
};

export const getPathPrefix = (): string => {
const varsAvailable = process.env.GATSBY_ENV_VARS_SET === "true";
const config = getConfig(window.location.hostname);

if (varsAvailable && process.env.USE_GITHUB_REPOSITORY_NAME_AS_PATH_PREFIX === "true") {
return `/${process.env.GITHUB_REPOSITORY_NAME}`;
}

if (config && config.USE_GITHUB_REPOSITORY_NAME_AS_PATH_PREFIX) {
return `/${config.GITHUB_REPOSITORY_NAME}`;
}

return "";
};
2 changes: 1 addition & 1 deletion pwa/src/templates/jumbotronTemplate/JumbotronTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const JumbotronTemplate: React.FC = () => {
<div
aria-label={t("Jumbotron")}
role="contentinfo"
style={{ backgroundImage: `url(${window.sessionStorage.getItem("JUMBOTRON_IMAGE_URL")})` }}
style={{ backgroundImage: `url("${window.sessionStorage.getItem("JUMBOTRON_IMAGE_URL")}")` }}
className={styles.wrapper}
>
<Page>
Expand Down
2 changes: 1 addition & 1 deletion pwa/static/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ GATSBY_FOOTER_CONTENT_HEADER=""
GATSBY_OIDN_NUMBER=""

# Deployment option, if you're using this .env file DO NOT REMOVE OR EDIT THIS
# GATSBY_ENV_VARS_SET="true"
GATSBY_ENV_VARS_SET="true"

0 comments on commit 88de4da

Please sign in to comment.