From 63b32feb3818cff0f196f3566860f756861822a7 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sat, 16 Dec 2023 15:52:26 +0800 Subject: [PATCH] Added set types to restriction components and added placeholder content for students and teachers in dashboard page --- src/Components/RestrictedComponent/RestrictedComponent.tsx | 2 +- src/Components/RestrictedPage/RestrictedPage.tsx | 2 +- src/Pages/DashboardPage/DashboardPage.tsx | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Components/RestrictedComponent/RestrictedComponent.tsx b/src/Components/RestrictedComponent/RestrictedComponent.tsx index 8517d54..23ee51f 100644 --- a/src/Components/RestrictedComponent/RestrictedComponent.tsx +++ b/src/Components/RestrictedComponent/RestrictedComponent.tsx @@ -5,7 +5,7 @@ import { CircularProgress } from "@mui/material"; import styles from "../../styles"; type props = { - allow_only: string; + allow_only: "Student" | "Teacher" | "Technician"; children: React.ReactNode; }; export default function RestrictedComponent(props: props) { diff --git a/src/Components/RestrictedPage/RestrictedPage.tsx b/src/Components/RestrictedPage/RestrictedPage.tsx index 8e9f6a0..72ef79b 100644 --- a/src/Components/RestrictedPage/RestrictedPage.tsx +++ b/src/Components/RestrictedPage/RestrictedPage.tsx @@ -5,7 +5,7 @@ import { toast } from "react-toastify"; import { useQuery } from "@tanstack/react-query"; type props = { - allow_only: string; + allow_only: "Student" | "Teacher" | "Technician"; }; export default function RestrictedPage(props: props) { const navigate = useNavigate(); diff --git a/src/Pages/DashboardPage/DashboardPage.tsx b/src/Pages/DashboardPage/DashboardPage.tsx index c15b6c7..3da5e1f 100644 --- a/src/Pages/DashboardPage/DashboardPage.tsx +++ b/src/Pages/DashboardPage/DashboardPage.tsx @@ -13,6 +13,12 @@ export default function Dashboard() { + +

Welcome student!

+
+ +

Welcome teacher!

+
); }