feat: fullscreen disabling on old browsers

This commit is contained in:
TrèsAbhi committed 2024-01-16 14:09:19 -06:00
1 parent 7e1949ccc7
commit 512134162d
1 file changed
+3
@@ -19,6 +19,7 @@ export function Options({ isFullScreen, canvas }: OptionsProps) {
const greenPenetration = useTankopedia( const greenPenetration = useTankopedia(
(state) => state.model.visual.greenPenetration, (state) => state.model.visual.greenPenetration,
); );
const fullScreenAvailable = document.fullscreenEnabled;
return ( return (
<Flex <Flex
@@ -61,6 +62,7 @@ export function Options({ isFullScreen, canvas }: OptionsProps) {
</DropdownMenu.Content> </DropdownMenu.Content>
</DropdownMenu.Root> </DropdownMenu.Root>
{fullScreenAvailable && (
<Button <Button
variant="ghost" variant="ghost"
onClick={() => { onClick={() => {
@@ -73,6 +75,7 @@ export function Options({ isFullScreen, canvas }: OptionsProps) {
> >
{isFullScreen ? <ExitFullScreenIcon /> : <EnterFullScreenIcon />} {isFullScreen ? <ExitFullScreenIcon /> : <EnterFullScreenIcon />}
</Button> </Button>
)}
</Flex> </Flex>
); );
} }