diff --git a/frontend/src/components/Navigation.tsx b/frontend/src/components/Navigation.tsx index b789e24..dc34747 100644 --- a/frontend/src/components/Navigation.tsx +++ b/frontend/src/components/Navigation.tsx @@ -10,7 +10,7 @@ import Link from "next/link"; import { useRouter } from "next/router"; import React, { useEffect } from "react"; -import { navigation } from "../constants/navigation"; +import { useNavigation } from "../constants/navigation"; import { useWindowSize } from "../hooks/useWindowSize"; import { cn } from "../lib/utils"; @@ -51,6 +51,7 @@ const Logo = ({ setShelf, isMobile, black }: LinkProps & { black?: boolean }) => // the mapping of elements within navigation const Links = ({ setShelf, isMobile }: LinkProps) => { const router = useRouter(); + const navigation = useNavigation(); return navigation.map((item, i) => { return ( @@ -81,6 +82,7 @@ function Navigation({ children }: { children: React.ReactNode }) { const [offset, setOffset] = React.useState(0); const [shelf, setShelf] = React.useState(false); // on mobile whether the navbar is open const { isMobile } = useWindowSize(); + const navigation = useNavigation(); useEffect(() => { const ordering = navigation.map((item) => item.href); diff --git a/frontend/src/components/StudentFormButton.tsx b/frontend/src/components/StudentFormButton.tsx index 7ac3eae..ebe7cb0 100644 --- a/frontend/src/components/StudentFormButton.tsx +++ b/frontend/src/components/StudentFormButton.tsx @@ -14,6 +14,8 @@ import { ProgramsContext } from "./StudentsTable/StudentsTable"; import { StudentMap } from "./StudentsTable/types"; import { Dialog, DialogClose, DialogContent, DialogTrigger } from "./ui/dialog"; +import { UserContext } from "@/contexts/user"; + type BaseProps = { classname?: string; setAllStudents: Dispatch>; @@ -50,6 +52,7 @@ export default function StudentFormButton({ const [openForm, setOpenForm] = useState(false); const programsMap = useContext(ProgramsContext); const allPrograms = useMemo(() => Object.values(programsMap), [programsMap]); + const { isAdmin } = useContext(UserContext); const onFormSubmit: SubmitHandler = (formData: StudentFormData) => { const programAbbreviationToId = {} as Record; // abbreviation -> programId @@ -178,11 +181,11 @@ export default function StudentFormButton({ classname, )} > -
+
Contact Information
-
+
Student Background
-
+
Student Information
{/* Modal Confirmation Dialog */} - - -
- - - + + + ) : ( +