added new endpoint for top bar data #28
@@ -1,21 +1,25 @@
|
||||
import React, { useState } from 'react'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { Outlet } from 'react-router-dom'
|
||||
// import MainLoaderBS from '../loaders/MainLoaderBS'
|
||||
import MainLoaderBS from '../loaders/MainLoaderBS'
|
||||
|
||||
export default function AuthLayout() {
|
||||
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [loading, setLoading] = useState(true)
|
||||
|
||||
// useEffect(()=>{
|
||||
// const timer = setTimeout(()=>{
|
||||
// setLoading(false)
|
||||
// },500)
|
||||
useEffect(()=>{
|
||||
const timer = setTimeout(()=>{
|
||||
setLoading(false)
|
||||
},500)
|
||||
|
||||
// return () => clearTimeout(timer)
|
||||
// },[])
|
||||
return () => clearTimeout(timer)
|
||||
},[])
|
||||
return (
|
||||
<div className="bg-white">
|
||||
<Outlet />
|
||||
{loading ?
|
||||
<MainLoaderBS />
|
||||
:
|
||||
<Outlet />
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user