mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-02 02:30:29 +00:00
Add apollo provider logic
This commit is contained in:
+14
-6
@@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
|
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
|
||||||
import { ThemeProvider } from 'styled-components';
|
import { ThemeProvider } from 'styled-components';
|
||||||
import { BrowserRouter } from 'react-router-dom';
|
import { BrowserRouter } from 'react-router-dom';
|
||||||
import { theme } from './themes';
|
import { theme } from './themes';
|
||||||
@@ -7,14 +8,21 @@ import App from './App';
|
|||||||
import GlobalStyles from './GlobalStyles';
|
import GlobalStyles from './GlobalStyles';
|
||||||
import reportWebVitals from './reportWebVitals';
|
import reportWebVitals from './reportWebVitals';
|
||||||
|
|
||||||
|
const client = new ApolloClient({
|
||||||
|
uri: process.env.REACT_APP_GRAPHQL_API,
|
||||||
|
cache: new InMemoryCache(),
|
||||||
|
});
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<ThemeProvider theme={theme}>
|
<ApolloProvider client={client}>
|
||||||
<BrowserRouter>
|
<ThemeProvider theme={theme}>
|
||||||
<App />
|
<BrowserRouter>
|
||||||
<GlobalStyles />
|
<App />
|
||||||
</BrowserRouter>
|
<GlobalStyles />
|
||||||
</ThemeProvider>
|
</BrowserRouter>
|
||||||
|
</ThemeProvider>
|
||||||
|
</ApolloProvider>
|
||||||
</React.StrictMode>,
|
</React.StrictMode>,
|
||||||
document.getElementById('root')
|
document.getElementById('root')
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user