Spaces:
Sleeping
Sleeping
Upload client/src/components/Layout.tsx with huggingface_hub
Browse files
client/src/components/Layout.tsx
CHANGED
|
@@ -114,7 +114,7 @@ const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
|
| 114 |
window.location.href = '/';
|
| 115 |
};
|
| 116 |
|
| 117 |
-
|
| 118 |
{ name: 'Home', href: '/dashboard', icon: HomeIcon },
|
| 119 |
{ name: 'Tutorial Tasks', href: '/tutorial-tasks', icon: AcademicCapIcon },
|
| 120 |
{ name: 'Weekly Practice', href: '/weekly-practice', icon: BookOpenIcon },
|
|
@@ -124,6 +124,11 @@ const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
|
| 124 |
{ name: 'Feedback', href: '/feedback', icon: UserIcon },
|
| 125 |
];
|
| 126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
// Add Manage link for admin users
|
| 128 |
if (user?.role === 'admin') {
|
| 129 |
navigation.push({ name: 'Manage', href: '/manage', icon: UserIcon });
|
|
|
|
| 114 |
window.location.href = '/';
|
| 115 |
};
|
| 116 |
|
| 117 |
+
let navigation = [
|
| 118 |
{ name: 'Home', href: '/dashboard', icon: HomeIcon },
|
| 119 |
{ name: 'Tutorial Tasks', href: '/tutorial-tasks', icon: AcademicCapIcon },
|
| 120 |
{ name: 'Weekly Practice', href: '/weekly-practice', icon: BookOpenIcon },
|
|
|
|
| 124 |
{ name: 'Feedback', href: '/feedback', icon: UserIcon },
|
| 125 |
];
|
| 126 |
|
| 127 |
+
// Hide Slides for visitors
|
| 128 |
+
if (!user || user.role === 'visitor') {
|
| 129 |
+
navigation = navigation.filter(item => item.name !== 'Slides');
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
// Add Manage link for admin users
|
| 133 |
if (user?.role === 'admin') {
|
| 134 |
navigation.push({ name: 'Manage', href: '/manage', icon: UserIcon });
|