diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index cbda0ee..2c93a7e 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -1,11 +1,18 @@ import React from 'react'; import { Navigation } from './Navigation'; +import { useStore } from '../store/useStore'; +import { useDisplay } from '../hooks/useDisplay'; export const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => { + const { isRailExpanded } = useStore(); + const { navMode } = useDisplay(); + + const isExpanded = navMode === 'rail-expanded' && isRailExpanded; + return (
-
+
{children}
diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index 5395601..fee1d9b 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -1,37 +1,84 @@ -import React from 'react'; +import React, { useState } from 'react'; import { NavLink } from 'react-router-dom'; -import { User, Calendar, GraduationCap, MessageSquare, Settings } from 'lucide-react'; +import { + Calendar, + GraduationCap, + FileText, + MessageSquare, + User, + ChevronDown, + ChevronRight, + Menu +} from 'lucide-react'; +import { useStore } from '../store/useStore'; +import { useDisplay } from '../hooks/useDisplay'; +import { useScrollDirection } from '../hooks/useScrollDirection'; -const navItems = [ - { path: '/profile', label: 'Profile', icon: User }, - { path: '/schedule', label: 'Schedule', icon: Calendar }, - { path: '/grades', label: 'Grades', icon: GraduationCap }, - { path: '/messages', label: 'Messages', icon: MessageSquare }, - { path: '/settings', label: 'Settings', icon: Settings }, +interface NavItem { + path: string; + label: string; + icon: any; + iconFilled: any; + badgeKey?: 'messages'; + children?: { path: string; label: string }[]; +} + +const navItems: NavItem[] = [ + { path: '/profile', label: 'Профиль', icon: User, iconFilled: User }, + { + path: '/schedule', + label: 'Расписание', + icon: Calendar, + iconFilled: Calendar, + children: [ + { path: '/schedule/week', label: 'Текущая неделя' }, + { path: '/schedule/session', label: 'Сессия' }, + ] + }, + { + path: '/grades', + label: 'Успеваемость', + icon: GraduationCap, + iconFilled: GraduationCap, + children: [ + { path: '/grades/list', label: 'Оценки' }, + { path: '/grades/statements', label: 'Ведомости' }, + ] + }, + { + path: '/docs', + label: 'Документы', + icon: FileText, + iconFilled: FileText, + children: [ + { path: '/docs/certs', label: 'Справки' }, + { path: '/docs/apps', label: 'Заявления' }, + ] + }, + { path: '/messages', label: 'Сообщения', icon: MessageSquare, iconFilled: MessageSquare, badgeKey: 'messages' }, ]; export const Navigation: React.FC = () => { - return ( - <> - + const { navMode } = useDisplay(); + const { isRailExpanded, toggleRail, badges } = useStore(); + const scrollDir = useScrollDirection(); + const [expandedItems, setExpandedItems] = useState([]); -