mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 11:53:49 +00:00
4c88f90a15
* feat: add lock icon when param `locked=true` * chore: move `isViewLocked` logic up the component tree * chore: remove extra container from lock icon * chore: move fading logic into separate hook * chore: move locked icon into separate component * chore: rename variables
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { IoApps } from '@react-icons/all-files/io5/IoApps';
|
|
import { IoSettingsOutline } from '@react-icons/all-files/io5/IoSettingsOutline';
|
|
|
|
import { useFadeOutOnInactivity } from '../../../common/hooks/useFadeOutOnInactivity';
|
|
|
|
import style from './NavigationMenu.module.scss';
|
|
|
|
interface FloatingNavigationProps {
|
|
toggleMenu: () => void;
|
|
toggleSettings: () => void;
|
|
}
|
|
|
|
export default function FloatingNavigation(props: FloatingNavigationProps) {
|
|
const { toggleMenu, toggleSettings } = props;
|
|
const isButtonShown = useFadeOutOnInactivity();
|
|
|
|
return (
|
|
<div className={`${style.buttonContainer} ${!isButtonShown ? style.hidden : ''}`}>
|
|
<button
|
|
onClick={toggleMenu}
|
|
aria-label='toggle menu'
|
|
className={style.navButton}
|
|
data-testid='navigation__toggle-menu'
|
|
>
|
|
<IoApps />
|
|
</button>
|
|
<button
|
|
className={style.button}
|
|
onClick={toggleSettings}
|
|
aria-label='toggle settings'
|
|
data-testid='navigation__toggle-settings'
|
|
>
|
|
<IoSettingsOutline />
|
|
</button>
|
|
</div>
|
|
);
|
|
}
|