Moved config to infrastructure :)

This commit is contained in:
2022-07-25 11:20:14 +02:00
parent 33fe4249a2
commit 87e5d4067a
6 changed files with 3 additions and 3 deletions

View File

@@ -0,0 +1,4 @@
export interface RunTimeConfig {
version: number;
name: string;
}

View File

@@ -0,0 +1,15 @@
import deepmerge from "deepmerge";
/**
* gets and merges both the regular config and the override config from the window
* into window.mergedConfig
*/
export const mergeConfigs = () => {
if (!window.mergedConfig) {
window.mergedConfig = deepmerge(window.defaultConfig, window.configOverride ?? {});
}
};
mergeConfigs();
export const Config = window.mergedConfig;

View File

@@ -0,0 +1 @@
export * from "./config";

View File

@@ -2,7 +2,7 @@ import { DateTime } from "luxon";
import { FunctionComponent } from "react";
import { Trans, useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import { Config } from "../../config";
import { Config } from "../config";
import "./Navbar.css";
type Props = {};