mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 11:36:36 +08:00
34 lines
968 B
TypeScript
34 lines
968 B
TypeScript
import React from 'react'
|
|
import ReactDOM from 'react-dom/client'
|
|
import { BrowserRouter } from 'react-router-dom'
|
|
import { Toaster } from 'react-hot-toast'
|
|
|
|
import App from './App'
|
|
import { GlobalEvents } from './components/GlobalEvents'
|
|
import { initializeThemeMode } from './components/useThemeMode'
|
|
import './index.css'
|
|
|
|
initializeThemeMode()
|
|
|
|
if ('serviceWorker' in navigator && import.meta.env.PROD) {
|
|
window.addEventListener('load', () => {
|
|
navigator.serviceWorker.register('/artwork-cache-sw.js').catch(() => undefined)
|
|
})
|
|
}
|
|
|
|
// Application root: BrowserRouter + global toast container.
|
|
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
|
|
<React.StrictMode>
|
|
<BrowserRouter>
|
|
<GlobalEvents />
|
|
<App />
|
|
<Toaster
|
|
position="top-right"
|
|
toastOptions={{
|
|
className: '!bg-surface-800 !text-white !border !border-white/10',
|
|
}}
|
|
/>
|
|
</BrowserRouter>
|
|
</React.StrictMode>,
|
|
)
|