2024-06-07 11:13:32 +00:00
|
|
|
import { Experimental_CssVarsProvider as CssVarsProvider } from '@mui/material/styles'
|
2024-02-28 16:49:44 +00:00
|
|
|
import _ from 'lodash'
|
2024-02-27 14:03:15 +00:00
|
|
|
import React from 'react'
|
|
|
|
import ReactDOM from 'react-dom/client'
|
2024-02-28 16:49:44 +00:00
|
|
|
import { Provider } from 'react-redux'
|
2024-05-08 14:00:39 +00:00
|
|
|
import { HashRouter } from 'react-router-dom'
|
2024-02-28 16:49:44 +00:00
|
|
|
import { ToastContainer } from 'react-toastify'
|
|
|
|
import 'react-toastify/dist/ReactToastify.css'
|
2024-02-27 14:03:15 +00:00
|
|
|
import App from './App.tsx'
|
|
|
|
import './index.css'
|
2024-02-28 16:49:44 +00:00
|
|
|
import store from './store/store.ts'
|
2024-06-07 11:13:32 +00:00
|
|
|
import { theme } from './theme'
|
2024-02-28 16:49:44 +00:00
|
|
|
import { saveState } from './utils'
|
|
|
|
|
|
|
|
store.subscribe(
|
|
|
|
_.throttle(() => {
|
|
|
|
saveState({
|
2024-03-19 10:27:18 +00:00
|
|
|
auth: store.getState().auth,
|
2024-05-17 11:33:01 +00:00
|
|
|
metadata: store.getState().metadata,
|
2024-05-28 09:22:31 +00:00
|
|
|
userRobotImage: store.getState().userRobotImage,
|
|
|
|
relays: store.getState().relays
|
2024-02-28 16:49:44 +00:00
|
|
|
})
|
|
|
|
}, 1000)
|
|
|
|
)
|
2024-02-27 14:03:15 +00:00
|
|
|
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
|
|
<React.StrictMode>
|
2024-06-07 11:13:32 +00:00
|
|
|
<CssVarsProvider theme={theme}>
|
|
|
|
<HashRouter>
|
|
|
|
<Provider store={store}>
|
|
|
|
<App />
|
|
|
|
<ToastContainer />
|
|
|
|
</Provider>
|
|
|
|
</HashRouter>
|
|
|
|
</CssVarsProvider>
|
2024-02-28 16:49:44 +00:00
|
|
|
</React.StrictMode>
|
2024-02-27 14:03:15 +00:00
|
|
|
)
|