Signed-off-by: Julius Volz <julius.volz@gmail.com>mantine-ui-uplot
parent
edf31da311
commit
8fae131733
@ -1,33 +1,14 @@ |
||||
import React from "react"; |
||||
import ReactDOM from "react-dom/client"; |
||||
import App from "./App.tsx"; |
||||
import { Settings, SettingsContext } from "./settings.ts"; |
||||
import store from "./state/store.ts"; |
||||
import { Provider } from "react-redux"; |
||||
import "./fonts/codicon.ttf"; |
||||
|
||||
// Declared/defined in public/index.html, value replaced by Prometheus when serving bundle.
|
||||
declare const GLOBAL_CONSOLES_LINK: string; |
||||
declare const GLOBAL_AGENT_MODE: string; |
||||
declare const GLOBAL_READY: string; |
||||
|
||||
const settings: Settings = { |
||||
consolesLink: |
||||
GLOBAL_CONSOLES_LINK === "CONSOLES_LINK_PLACEHOLDER" || |
||||
GLOBAL_CONSOLES_LINK === "" || |
||||
GLOBAL_CONSOLES_LINK === null |
||||
? null |
||||
: GLOBAL_CONSOLES_LINK, |
||||
agentMode: GLOBAL_AGENT_MODE === "true", |
||||
ready: GLOBAL_READY === "true", |
||||
}; |
||||
|
||||
ReactDOM.createRoot(document.getElementById("root")!).render( |
||||
<React.StrictMode> |
||||
<SettingsContext.Provider value={settings}> |
||||
<Provider store={store}> |
||||
<App /> |
||||
</Provider> |
||||
</SettingsContext.Provider> |
||||
<Provider store={store}> |
||||
<App /> |
||||
</Provider> |
||||
</React.StrictMode> |
||||
); |
||||
|
||||
@ -1,13 +0,0 @@ |
||||
import { createContext } from "react"; |
||||
|
||||
export interface Settings { |
||||
consolesLink: string | null; |
||||
agentMode: boolean; |
||||
ready: boolean; |
||||
} |
||||
|
||||
export const SettingsContext = createContext<Settings>({ |
||||
consolesLink: null, |
||||
agentMode: false, |
||||
ready: false, |
||||
}); |
||||
Loading…
Reference in new issue