1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 21:14:18 +00:00
pds-2021-g2-nest/code/frontend/src/routes/PageRoot.js

15 lines
327 B
JavaScript
Raw Normal View History

import React, { useContext } from "react"
import ContextLogin from "../contexts/ContextLogin"
import { Redirect } from "react-router"
export default function PageRoot() {
const {state} = useContext(ContextLogin)
if(!state) {
return <Redirect to={"/login"}/>
}
return <Redirect to={"/dashboard"}/>
}