mirror of
https://github.com/lemeow125/Ivy-Frontend.git
synced 2025-05-14 10:31:07 +08:00
Restrict all pages to only logged in users
This commit is contained in:
parent
18d9fbe1ef
commit
9cdca33783
6 changed files with 40 additions and 2 deletions
|
@ -11,8 +11,15 @@ import {
|
|||
} from "@mui/material";
|
||||
import { SampleInventoryData } from "../../Components/SampleData/SampleData";
|
||||
import StockRenderer from "../../Components/InventoryPage/StockRenderer/StockRenderer";
|
||||
import { Navigate } from "react-router-dom";
|
||||
import { LoginState } from "../../Interfaces/Interfaces";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export default function Inventory() {
|
||||
const logged_in = useSelector((state: LoginState) => state.logged_in.value);
|
||||
if (!logged_in) {
|
||||
return <Navigate to="/Login" replace />;
|
||||
}
|
||||
return (
|
||||
<div style={{ height: "100%" }}>
|
||||
<div style={styles.content_row}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue