+
}
+ showOnMobileOnly
+ />
}
- active={
- pathname.includes(coursesPath) || pathname.endsWith(dashboardPath)
- }
dropdown={[
+ {
+ text: t('words.dashboard'),
+ to: '/dashboard/courses',
+ onClick: toggleMobileMenu,
+ },
...(inProgressCourses ?? []),
...(completedCourses && completedCourses.length > 0
- ? [{ text: 'Completed', to: '/dashboard/course/completed' }]
+ ? [
+ {
+ text: t('dashboard.myCourses.completed'),
+ to: '/dashboard/course/completed',
+ onClick: toggleMobileMenu,
+ },
+ ]
: []),
]}
/>
@@ -117,6 +142,7 @@ export const MenuDesktop = ({
text={t('dashboard.calendar.calendar')}
icon={
}
active={pathname.includes(calendarPath)}
+ onClick={toggleMobileMenu}
/>
@@ -124,6 +150,7 @@ export const MenuDesktop = ({
text={t('words.bookings')}
icon={
}
active={pathname.includes(bookingsPath)}
+ onClick={toggleMobileMenu}
/>
@@ -131,6 +158,7 @@ export const MenuDesktop = ({
text={t('words.credentials')}
icon={
}
active={pathname.includes(credentialsPath)}
+ onClick={toggleMobileMenu}
/>
@@ -138,48 +166,17 @@ export const MenuDesktop = ({
text={t('dashboard.account')}
icon={
}
active={pathname.includes(profilePath)}
+ onClick={toggleMobileMenu}
/>
- {user && (user.role === 'admin' || user.role === 'superadmin') && (
- <>
-
-
-
- Admin menu
-
-
-
-
}
- active={pathname.includes(adminRolePath)}
- />
-
-
-
}
- active={pathname.includes(adminTutorialsPath)}
- />
-
-
-
}
- active={pathname.includes(adminBookingsPath)}
- />
-
- >
- )}
-
{user &&
(user.role === 'professor' ||
(['admin', 'superadmin'].includes(user.role) &&
user.professorId)) && (
<>
-
+
{t('dashboard.teacher.menu')}
@@ -187,6 +184,7 @@ export const MenuDesktop = ({
text={t('dashboard.profile.profile')}
icon={
}
active={pathname.includes(professorProfilePath)}
+ onClick={toggleMobileMenu}
/>
{user.professorCourses?.length > 0 && (
@@ -195,6 +193,7 @@ export const MenuDesktop = ({
text={t('dashboard.courses')}
icon={
}
active={pathname.includes(professorCoursesPath)}
+ onClick={toggleMobileMenu}
/>
)}
@@ -204,23 +203,63 @@ export const MenuDesktop = ({
text={t('words.tutorials')}
icon={
}
active={pathname.includes(professorTutorialsPath)}
+ onClick={toggleMobileMenu}
/>
)}
>
)}
+ {user && (user.role === 'admin' || user.role === 'superadmin') && (
+ <>
+
+
+
+ Admin menu
+
+
+
+
}
+ active={pathname.includes(adminRolePath)}
+ onClick={toggleMobileMenu}
+ />
+
+
+
}
+ active={pathname.includes(adminTutorialsPath)}
+ onClick={toggleMobileMenu}
+ />
+
+
+
}
+ active={pathname.includes(adminBookingsPath)}
+ onClick={toggleMobileMenu}
+ />
+
+ >
+ )}
+
-
}
+