2023-09-05 00:23:53 +03:00
|
|
|
import { useConceptNavigation } from '../../context/NagivationContext';
|
2023-07-25 20:27:29 +03:00
|
|
|
import { useConceptTheme } from '../../context/ThemeContext';
|
2023-09-03 18:26:50 +03:00
|
|
|
import { EducationIcon, LibraryIcon, PlusIcon } from '../Icons';
|
2023-07-25 20:27:29 +03:00
|
|
|
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-09-05 00:23:53 +03:00
|
|
|
const { navigateTo } = useConceptNavigation();
|
2023-07-25 00:20:37 +03:00
|
|
|
const { noNavigation, toggleNoNavigation } = useConceptTheme();
|
2023-07-15 17:46:19 +03:00
|
|
|
|
2023-09-05 00:23:53 +03:00
|
|
|
const navigateLibrary = () => navigateTo('/library');
|
|
|
|
const navigateHelp = () => navigateTo('/manuals');
|
|
|
|
const navigateCreateNew = () => navigateTo('/rsform-create');
|
2023-07-25 20:27:29 +03:00
|
|
|
|
2023-07-15 17:46:19 +03:00
|
|
|
return (
|
2023-12-05 01:22:44 +03:00
|
|
|
<nav className='sticky top-0 left-0 right-0 select-none clr-app z-navigation h-fit'>
|
|
|
|
<ToggleNavigationButton noNavigation={noNavigation} toggleNoNavigation={toggleNoNavigation} />
|
|
|
|
{!noNavigation ?
|
|
|
|
<div className='flex items-stretch justify-between pl-2 pr-[0.8rem] border-b-2 rounded-none h-[3rem]'>
|
|
|
|
<div className='flex items-center justify-start'>
|
|
|
|
<Logo />
|
|
|
|
</div>
|
|
|
|
<div className='flex items-center h-full'>
|
|
|
|
<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
|
|
|
}
|
|
|
|
|
|
|
|
export default Navigation;
|