From aea42344ded1708361e7e1d577e9c6aa370ad64e Mon Sep 17 00:00:00 2001
From: ludovicm67 <ludovicmuller1@gmail.com>
Date: Fri, 31 Jan 2020 12:18:19 +0100
Subject: webui: transform index and App to TypeScript

---
 webui/src/index.tsx | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 webui/src/index.tsx

(limited to 'webui/src/index.tsx')

diff --git a/webui/src/index.tsx b/webui/src/index.tsx
new file mode 100644
index 00000000..6f838c69
--- /dev/null
+++ b/webui/src/index.tsx
@@ -0,0 +1,38 @@
+import ThemeProvider from '@material-ui/styles/ThemeProvider';
+import { createMuiTheme } from '@material-ui/core/styles';
+import ApolloClient from 'apollo-boost';
+import {
+  IntrospectionFragmentMatcher,
+  InMemoryCache,
+} from 'apollo-cache-inmemory';
+import React from 'react';
+import { ApolloProvider } from 'react-apollo';
+import ReactDOM from 'react-dom';
+import { BrowserRouter } from 'react-router-dom';
+
+import introspectionQueryResultData from './fragmentTypes';
+import App from './App';
+
+const theme = createMuiTheme();
+
+const client = new ApolloClient({
+  uri: '/graphql',
+  cache: new InMemoryCache({
+    fragmentMatcher: new IntrospectionFragmentMatcher({
+      introspectionQueryResultData,
+    }),
+  }),
+});
+
+ReactDOM.render(
+  <ApolloProvider client={client}>
+    <BrowserRouter>
+      <ThemeProvider theme={theme}>
+        <React.Suspense fallback={'Loading…'}>
+          <App />
+        </React.Suspense>
+      </ThemeProvider>
+    </BrowserRouter>
+  </ApolloProvider>,
+  document.getElementById('root')
+);
-- 
cgit 

