linguabot commited on
Commit
558bec8
·
verified ·
1 Parent(s): 0515895

Upload client/src/components/Layout.tsx with huggingface_hub

Browse files
Files changed (1) hide show
  1. client/src/components/Layout.tsx +6 -1
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
- const 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,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 });