aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/index.js
diff options
context:
space:
mode:
authorQuentin Gliech <quentingliech@gmail.com>2019-04-10 21:19:45 +0200
committerQuentin Gliech <quentingliech@gmail.com>2019-05-22 19:52:01 +0200
commitd79ef7a7945ba82caeec62cad44dad134c9edfbc (patch)
tree392d9ceaead2a5780862ecf89cf1cc2a0c550ed7 /webui/src/index.js
parent1a7ccd594adc6f185115ce12a4368c55ff418678 (diff)
downloadgit-bug-d79ef7a7945ba82caeec62cad44dad134c9edfbc.tar.gz
webui: Migrate to Material-UI's new style API
Diffstat (limited to 'webui/src/index.js')
-rw-r--r--webui/src/index.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/webui/src/index.js b/webui/src/index.js
index f5d95ccc..885911f5 100644
--- a/webui/src/index.js
+++ b/webui/src/index.js
@@ -1,22 +1,31 @@
+import { install } from '@material-ui/styles';
+import ThemeProvider from '@material-ui/styles/ThemeProvider';
+import { createMuiTheme } from '@material-ui/core/styles';
import ApolloClient from 'apollo-boost';
import React from 'react';
import { ApolloProvider } from 'react-apollo';
import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
-import App from './App';
+install();
+
+// TODO(sandhose): this is temporary until Material-UI v4 goes out
+const App = React.lazy(() => import('./App'));
+
+const theme = createMuiTheme();
const client = new ApolloClient({
uri: '/graphql',
- connectToDevTools: true,
});
ReactDOM.render(
<ApolloProvider client={client}>
<BrowserRouter>
- <React.Fragment>
- <App />
- </React.Fragment>
+ <ThemeProvider theme={theme}>
+ <React.Suspense fallback={'Loading…'}>
+ <App />
+ </React.Suspense>
+ </ThemeProvider>
</BrowserRouter>
</ApolloProvider>,
document.getElementById('root')