sigit.io/src/main.tsx

38 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-06-07 11:13:32 +00:00
import { Experimental_CssVarsProvider as CssVarsProvider } from '@mui/material/styles'
import _ from 'lodash'
2024-02-27 14:03:15 +00:00
import React from 'react'
import ReactDOM from 'react-dom/client'
import { Provider } from 'react-redux'
import { HashRouter } from 'react-router-dom'
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'
import store from './store/store.ts'
2024-06-07 11:13:32 +00:00
import { theme } from './theme'
import { saveState } from './utils'
store.subscribe(
_.throttle(() => {
saveState({
2024-03-19 10:27:18 +00:00
auth: store.getState().auth,
metadata: store.getState().metadata,
userRobotImage: store.getState().userRobotImage,
relays: store.getState().relays
})
}, 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>
</React.StrictMode>
2024-02-27 14:03:15 +00:00
)