2023-12-15 17:34:50 +03:00
|
|
|
import clsx from 'clsx';
|
|
|
|
|
|
|
|
import { EducationIcon, LibraryIcon, PlusIcon } from '@/components/Icons';
|
2023-12-13 14:32:57 +03:00
|
|
|
import { useConceptNavigation } from '@/context/NagivationContext';
|
|
|
|
import { useConceptTheme } from '@/context/ThemeContext';
|
|
|
|
|
|
|
|
import Logo from './Logo';
|
2023-07-15 17:46:19 +03:00
|
|
|
import NavigationButton from './NavigationButton';
|
2023-12-05 01:22:44 +03:00
|
|
|
import ToggleNavigationButton from './ToggleNavigationButton';
|
2023-07-15 17:46:19 +03:00
|
|
|
import UserMenu from './UserMenu';
|
|
|
|
|
2023-07-25 20:27:29 +03:00
|
|
|
function Navigation () {
|
2023-12-13 14:32:57 +03:00
|
|
|
const router = useConceptNavigation();
|
2023-12-08 19:24:08 +03:00
|
|
|
const { noNavigation } = useConceptTheme();
|
2023-07-15 17:46:19 +03:00
|
|
|
|
2023-12-13 14:32:57 +03:00
|
|
|
const navigateHome = () => router.push('/');
|
|
|
|
const navigateLibrary = () => router.push('/library');
|
|
|
|
const navigateHelp = () => router.push('/manuals');
|
|
|
|
const navigateCreateNew = () => router.push('/library/create');
|
2023-07-25 20:27:29 +03:00
|
|
|
|
2023-07-15 17:46:19 +03:00
|
|
|
return (
|
2023-12-15 17:34:50 +03:00
|
|
|
<nav className={clsx(
|
|
|
|
'z-navigation',
|
|
|
|
'sticky top-0 left-0 right-0',
|
|
|
|
'clr-app',
|
|
|
|
'select-none'
|
|
|
|
)}>
|
2023-12-08 19:24:08 +03:00
|
|
|
<ToggleNavigationButton />
|
2023-12-05 01:22:44 +03:00
|
|
|
{!noNavigation ?
|
2023-12-15 17:34:50 +03:00
|
|
|
<div
|
|
|
|
className={clsx(
|
2023-12-16 19:20:26 +03:00
|
|
|
'pl-2 pr-[0.9rem] h-[3rem]',
|
2023-12-15 17:34:50 +03:00
|
|
|
'flex justify-between',
|
|
|
|
'border-b-2 rounded-none'
|
|
|
|
)}
|
|
|
|
>
|
2023-12-13 14:32:57 +03:00
|
|
|
<div className='flex items-center mr-2 cursor-pointer' onClick={navigateHome} tabIndex={-1}>
|
2023-12-05 01:22:44 +03:00
|
|
|
<Logo />
|
|
|
|
</div>
|
2023-12-15 17:34:50 +03:00
|
|
|
<div className='flex'>
|
2023-12-05 01:22:44 +03:00
|
|
|
<NavigationButton
|
|
|
|
text='Новая схема'
|
|
|
|
description='Создать новую схему'
|
|
|
|
icon={<PlusIcon />}
|
|
|
|
onClick={navigateCreateNew}
|
|
|
|
/>
|
|
|
|
<NavigationButton
|
|
|
|
text='Библиотека'
|
|
|
|
description='Библиотека концептуальных схем'
|
|
|
|
icon={<LibraryIcon />}
|
|
|
|
onClick={navigateLibrary}
|
|
|
|
/>
|
|
|
|
<NavigationButton
|
|
|
|
text='Справка'
|
|
|
|
description='Справочные материалы и обучение'
|
|
|
|
icon={<EducationIcon />}
|
|
|
|
onClick={navigateHelp}
|
|
|
|
/>
|
|
|
|
<UserMenu />
|
|
|
|
</div>
|
|
|
|
</div> : null}
|
|
|
|
</nav>);
|
2023-07-15 17:46:19 +03:00
|
|
|
}
|
|
|
|
|
2023-12-15 17:34:50 +03:00
|
|
|
export default Navigation;
|