Added set types to restriction components and added placeholder content for students and teachers in dashboard page

This commit is contained in:
Keannu Bernasol 2023-12-16 15:52:26 +08:00
parent 34bb54f8b1
commit 63b32feb38
3 changed files with 8 additions and 2 deletions

View file

@ -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) {

View file

@ -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();

View file

@ -13,6 +13,12 @@ export default function Dashboard() {
<TechnicianEquipmentButtons />
<TechnicianLogButtons />
</RestrictedComponent>
<RestrictedComponent allow_only={"Student"}>
<p style={styles.text_dark}>Welcome student!</p>
</RestrictedComponent>
<RestrictedComponent allow_only={"Teacher"}>
<p style={styles.text_dark}>Welcome teacher!</p>
</RestrictedComponent>
</div>
);
}