mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-08 07:49:12 +00:00
refactor: extract navigation elements
This commit is contained in:
committed by
Carlos Valente
parent
7fdda1c969
commit
269091986a
+38
@@ -0,0 +1,38 @@
|
||||
import { IoLockClosedOutline } from 'react-icons/io5';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useViewportSize } from '@mantine/hooks';
|
||||
|
||||
import NavigationMenuItem from '../navigation-menu-item/NavigationMenuItem';
|
||||
|
||||
export default function EditorNavigation() {
|
||||
const { width } = useViewportSize();
|
||||
const navigate = useNavigate();
|
||||
|
||||
if (width > 1440) {
|
||||
return (
|
||||
<NavigationMenuItem active={location.pathname === '/editor'} onClick={() => navigate('/editor')}>
|
||||
<IoLockClosedOutline />
|
||||
Editor
|
||||
</NavigationMenuItem>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<NavigationMenuItem active={location.pathname === '/timercontrol'} onClick={() => navigate('/timercontrol')}>
|
||||
<IoLockClosedOutline />
|
||||
Timer Controls
|
||||
</NavigationMenuItem>
|
||||
|
||||
<NavigationMenuItem active={location.pathname === '/messagecontrol'} onClick={() => navigate('/messagecontrol')}>
|
||||
<IoLockClosedOutline />
|
||||
Message Controls
|
||||
</NavigationMenuItem>
|
||||
|
||||
<NavigationMenuItem active={location.pathname === '/rundown'} onClick={() => navigate('/rundown')}>
|
||||
<IoLockClosedOutline />
|
||||
Rundown
|
||||
</NavigationMenuItem>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user