authorization component added
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { useLocation, useNavigate, Outlet } from 'react-router-dom'
|
||||
|
||||
import myLinks from '../myLinks'
|
||||
import PageLoader from '../components/PageLoader'
|
||||
|
||||
export default function UserExists() {
|
||||
|
||||
const {state} = useLocation()
|
||||
|
||||
const navigate = useNavigate()
|
||||
|
||||
const [loading, setLoading] = useState(true)
|
||||
|
||||
useEffect(()=>{
|
||||
if(state?.proceed != 'true'){
|
||||
return navigate(myLinks.getStarted, {replace:true})
|
||||
}
|
||||
setTimeout(()=>{
|
||||
setLoading(false)
|
||||
},2000)
|
||||
},[])
|
||||
|
||||
return (
|
||||
<>
|
||||
{
|
||||
loading ?
|
||||
<PageLoader />
|
||||
:
|
||||
<Outlet />
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user