summaryrefslogtreecommitdiff
path: root/client/app.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'client/app.jsx')
-rw-r--r--client/app.jsx23
1 files changed, 19 insertions, 4 deletions
diff --git a/client/app.jsx b/client/app.jsx
index 5ae62df..6414fad 100644
--- a/client/app.jsx
+++ b/client/app.jsx
@@ -1,10 +1,25 @@
-import { BrowserRouter } from 'react-router-dom';
+import { useReducer } from 'react';
+import { HashRouter } from 'react-router-dom';
import { Router } from './components/router';
+import { SettingsContext } from './utils/settings_context';
+
+const settingsReducer = (state, action) => {
+ switch (action.type) {
+ case 'update': {
+ return { ...state, ...action.payload };
+ }
+ }
+ return state;
+};
export const App = () => {
+ const [settings, dispatch] = useReducer(settingsReducer, window.SETTINGS);
+
return (
- <BrowserRouter>
- <Router />
- </BrowserRouter>
+ <SettingsContext.Provider value={[settings, dispatch]}>
+ <HashRouter>
+ <Router />
+ </HashRouter>
+ </SettingsContext.Provider>
);
};