-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.jsx
34 lines (29 loc) · 1005 Bytes
/
index.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from 'react';
import {createRoot} from 'react-dom/client';
import Main from './components/Main/Main';
import {createTheme} from './carto-theme';
import {CssBaseline, ThemeProvider} from '@material-ui/core';
import {AppStateStore} from './state';
import {setDefaultCredentials} from '@deck.gl/carto';
const theme = createTheme();
const credentials = {
accessToken: 'eyJhbGciOiJIUzI1NiJ9.eyJhIjoiYWNfbHFlM3p3Z3UiLCJqdGkiOiJiMTAyZjgzYyJ9.R2P-6K41Sr3O8lRnJ14I4y9UDfR6xaQPWVpL383lXcE'
}
// For development use local endpoint via vite proxy (see vite.config.js)
const useLocalCache = location.host.includes('127.0.0.1');
if (useLocalCache) {
credentials.apiBaseUrl = '/carto-api/';
}
setDefaultCredentials(credentials);
const App = () => {
return (
<ThemeProvider theme={theme}>
<AppStateStore>
<CssBaseline />
<Main />
</AppStateStore>
</ThemeProvider>
);
};
const container = document.getElementById('app');
createRoot(container).render(<App />);