diff --git a/client/src/components/nav/TopNavbar.jsx b/client/src/components/nav/TopNavbar.jsx index a8ff46d..cf22a61 100644 --- a/client/src/components/nav/TopNavbar.jsx +++ b/client/src/components/nav/TopNavbar.jsx @@ -57,8 +57,9 @@ function LoggedIn(props) { return ( <> - {navItems.map((item) => ( + {navItems.map((item, index) => ( -
-

Welcome to MyClassroom

+
+

Welcome to MyClassroom

Open-Source Classroom Polling Software

-
-
-
+
+
+
-

Create courses and manage lectures easily.

+

Create courses and manage lectures easily.

-
+
-

Track student progress and manage grades.

+

Track student progress and manage grades.

-
+
-

Seamless integration with educational platforms.

+

Seamless integration with educational platforms.

-
+
-

Boost student engagement with interactive polls.

+

Boost student engagement with interactive polls.

-
+
-

Highly customizable and free to use.

+

Highly customizable and free to use.

) } -export default Home +export default Home \ No newline at end of file diff --git a/client/src/pages/SingleCoursePage.jsx b/client/src/pages/SingleCoursePage.jsx index 62e86e6..0643600 100644 --- a/client/src/pages/SingleCoursePage.jsx +++ b/client/src/pages/SingleCoursePage.jsx @@ -12,9 +12,11 @@ function DisplayCoursePage(){ const { courseId } = useParams() let navigate = useNavigate() const [ course, role, message, error, loading ] = useCourse() - if (role === "student") { - navigate(`/${courseId}/lectures`) - } + useEffect(() => { + if (role === "student") { + navigate(`/${courseId}/lectures`); + } + }, [role, navigate, courseId]); return <> { loading ? : (error ? :