24 lines
634 B
JavaScript
24 lines
634 B
JavaScript
import React from 'react'
|
|
import { createRoot } from 'react-dom/client'
|
|
import Topbar from './components/Topbar'
|
|
|
|
function mount() {
|
|
const container = document.getElementById('topbar-root')
|
|
if (!container) return
|
|
|
|
const root = createRoot(container)
|
|
root.render(<Topbar />)
|
|
|
|
// hide legacy header if present
|
|
const legacy = document.getElementById('legacy-topbar')
|
|
const topbar = document.getElementById('topbar')
|
|
if (legacy) legacy.style.display = 'none'
|
|
if (topbar) topbar.style.display = 'none'
|
|
}
|
|
|
|
if (document.readyState === 'loading') {
|
|
document.addEventListener('DOMContentLoaded', mount)
|
|
} else {
|
|
mount()
|
|
}
|