mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 01:43:43 +00:00
refactor: hide fullscreen button if not feature available
This commit is contained in:
committed by
Carlos Valente
parent
1f2706a063
commit
19d6b40bdb
@@ -5,7 +5,7 @@ import { useLocation } from 'react-router';
|
||||
import { Dialog } from '@base-ui-components/react/dialog';
|
||||
import { useDisclosure, useFullscreen } from '@mantine/hooks';
|
||||
|
||||
import { isLocalhost } from '../../../externals';
|
||||
import { isLocalhost, supportsFullscreen } from '../../../externals';
|
||||
import { useKeepAwakeOptions } from '../../../features/keep-awake/KeepAwake';
|
||||
import { navigatorConstants } from '../../../viewerConfig';
|
||||
import { useClientStore } from '../../stores/clientStore';
|
||||
@@ -56,10 +56,12 @@ function NavigationMenu({ isOpen, onClose }: NavigationMenuProps) {
|
||||
</IconButton>
|
||||
</div>
|
||||
<div className={style.body}>
|
||||
<NavigationMenuItem active={fullscreen} onClick={toggle}>
|
||||
Toggle Fullscreen
|
||||
{fullscreen ? <IoContract /> : <IoExpand />}
|
||||
</NavigationMenuItem>
|
||||
{supportsFullscreen && (
|
||||
<NavigationMenuItem active={fullscreen} onClick={toggle}>
|
||||
Toggle Fullscreen
|
||||
{fullscreen ? <IoContract /> : <IoExpand />}
|
||||
</NavigationMenuItem>
|
||||
)}
|
||||
<NavigationMenuItem active={mirror} onClick={() => toggleMirror()}>
|
||||
Flip Screen
|
||||
<IoSwapVertical />
|
||||
|
||||
@@ -23,7 +23,9 @@ export const isDev = import.meta.env.DEV;
|
||||
export const currentHostName = window.location.hostname;
|
||||
export const isLocalhost = currentHostName === 'localhost' || currentHostName === '127.0.0.1';
|
||||
export const isOntimeCloud = document.querySelector('base')?.hasAttribute('data-is-cloud')
|
||||
|
||||
export const isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
||||
export const supportsFullscreen = document.fullscreenEnabled;
|
||||
|
||||
// resolve entrypoint URLs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user