2023-12-15 17:34:50 +03:00
|
|
|
|
import clsx from 'clsx';
|
2023-12-08 19:24:08 +03:00
|
|
|
|
import { useMemo } from 'react';
|
|
|
|
|
|
2023-12-13 14:32:57 +03:00
|
|
|
|
import { useConceptTheme } from '@/context/ThemeContext';
|
2023-12-08 19:24:08 +03:00
|
|
|
|
|
|
|
|
|
function ToggleNavigationButton() {
|
|
|
|
|
const { noNavigation, toggleNoNavigation } = useConceptTheme();
|
|
|
|
|
const text = useMemo(() => (
|
2023-12-15 17:34:50 +03:00
|
|
|
|
noNavigation ?
|
|
|
|
|
'∨∨∨'
|
|
|
|
|
:
|
|
|
|
|
<>
|
|
|
|
|
<p>{'>'}</p>
|
|
|
|
|
<p>{'>'}</p>
|
|
|
|
|
</>
|
|
|
|
|
), [noNavigation]
|
2023-12-08 19:24:08 +03:00
|
|
|
|
);
|
|
|
|
|
return (
|
|
|
|
|
<button type='button' tabIndex={-1}
|
2023-12-15 17:34:50 +03:00
|
|
|
|
title={noNavigation ? 'Показать навигацию' : 'Скрыть навигацию'}
|
|
|
|
|
className={clsx(
|
|
|
|
|
'absolute top-0 right-0 z-navigation',
|
|
|
|
|
'border-b-2 border-l-2 rounded-none',
|
|
|
|
|
'clr-btn-nav',
|
|
|
|
|
{
|
|
|
|
|
'px-1 h-[1.6rem]': noNavigation,
|
|
|
|
|
'w-[1.2rem] h-[3rem]': !noNavigation
|
|
|
|
|
}
|
|
|
|
|
)}
|
2023-12-08 19:24:08 +03:00
|
|
|
|
onClick={toggleNoNavigation}
|
|
|
|
|
>
|
|
|
|
|
{text}
|
|
|
|
|
</button>);
|
2023-12-05 01:22:44 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ToggleNavigationButton;
|