Rework configuration process

Dynamically loads `config.json` on startup.

Fixes #167, #284, #449, #486

Change-Id: I9efb1079c0c88e6e0272c5fda734a367aa8f84a3
This commit is contained in:
Manuel Stahl
2024-02-05 17:32:32 +01:00
committed by Manuel Stahl
parent ef3836313c
commit 4b1277f653
11 changed files with 254 additions and 46 deletions

View File

@@ -1,9 +1,17 @@
import React from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
createRoot(document.getElementById("root")).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
import App from "./App";
import { AppContext } from "./AppContext";
fetch("config.json")
.then(res => res.json())
.then(props =>
createRoot(document.getElementById("root")).render(
<React.StrictMode>
<AppContext.Provider value={props}>
<App />
</AppContext.Provider>
</React.StrictMode>
)
);