mirror of
https://github.com/lemeow125/Ivy-Frontend.git
synced 2025-05-14 18:41:06 +08:00
Separated session checker and page login verifier into components
This commit is contained in:
parent
b12f205efd
commit
c3ae196b6c
10 changed files with 101 additions and 65 deletions
|
@ -8,18 +8,12 @@ import styles from "../../styles";
|
|||
import HomeIcon from "../../Components/Icons/HomeIcon/HomeIcon";
|
||||
import ColoredCube from "../../Components/ColoredCube/ColoredCube";
|
||||
import RecentlyAddedIcon from "../../Components/Icons/RecentlyAddedIcon/RecentlyAddedIcon";
|
||||
import { Navigate } from "react-router-dom";
|
||||
import { LoginState } from "../../Interfaces/Interfaces";
|
||||
import { useSelector } from "react-redux";
|
||||
import LoginChecker from "../../Components/LoginChecker/LoginChecker";
|
||||
|
||||
export default function Dashboard() {
|
||||
const logged_in = useSelector((state: LoginState) => state.logged_in.value);
|
||||
if (!logged_in) {
|
||||
return <Navigate to="/Login" replace />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<LoginChecker />
|
||||
<div style={styles.flex_row}>
|
||||
<HomeIcon size={64} color="white" />
|
||||
<h1 style={{ ...styles.text_white, ...styles.text_XL }}>Dashboard</h1>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue