fixed toolbar menu
This commit is contained in:
23
resources/js/entry-topbar.jsx
Normal file
23
resources/js/entry-topbar.jsx
Normal file
@@ -0,0 +1,23 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user