feat(directory): added a loader before dom is loaded

This commit is contained in:
Haoyu Xu
2023-10-13 22:47:17 -04:00
parent db55e71e39
commit 6b46e6fb0e
2 changed files with 84 additions and 12 deletions

View File

@@ -75,6 +75,14 @@ export default function Root() {
fetchOfficalUpdate()
}, [fetchOfficalUpdate])
useEffect(() => {
document.querySelector('.loader').classList.add('loaded')
setTimeout(() => {
document.querySelector('.loader').style.display = 'none'
}, 500)
}
, [])
return (
<>
<header className={header.header}>