Skip to content

Commit

Permalink
Put fullscreen toggle behind feature switch for vscode-wardleymaps.
Browse files Browse the repository at this point in the history
  • Loading branch information
ds committed Jan 6, 2024
1 parent 330d307 commit b8ef17c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
37 changes: 20 additions & 17 deletions frontend/src/components/map/MapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import React from 'react';
import MapCanvas from './MapCanvas';
import FullscreenIcon from '@mui/icons-material/Fullscreen';
import FullscreenExitIcon from '@mui/icons-material/FullscreenExit';

import { useFeatureSwitches } from '../FeatureSwitchesContext';
export default function MapView(props) {
const featureSwitches = useFeatureSwitches();
const fill = {
wardley: 'url(#wardleyGradient)',
colour: 'none',
Expand Down Expand Up @@ -46,22 +47,24 @@ export default function MapView(props) {
<div id="map">
<MapCanvas mapPadding={20} {...props} />
</div>
<IconButton
onClick={props.shouldHideNav}
color={textColour[props.mapStyleDefs.className]}
aria-label={props.hideNav ? 'Exit Fullscreen' : 'Fullscreen'}
sx={{ position: 'absolute', right: '10px', top: '0' }}
>
{props.hideNav ? (
<FullscreenExitIcon
sx={{ color: textColour[props.mapStyleDefs.className] }}
/>
) : (
<FullscreenIcon
sx={{ color: textColour[props.mapStyleDefs.className] }}
/>
)}
</IconButton>
{featureSwitches.showToggleFullscreen && (
<IconButton
onClick={props.shouldHideNav}
color={textColour[props.mapStyleDefs.className]}
aria-label={props.hideNav ? 'Exit Fullscreen' : 'Fullscreen'}
sx={{ position: 'absolute', right: '10px', top: '0' }}
>
{props.hideNav ? (
<FullscreenExitIcon
sx={{ color: textColour[props.mapStyleDefs.className] }}
/>
) : (
<FullscreenIcon
sx={{ color: textColour[props.mapStyleDefs.className] }}
/>
)}
</IconButton>
)}
</div>
</>
);
Expand Down
1 change: 1 addition & 0 deletions frontend/src/constants/featureswitches.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export const featureSwitches = {
enableLinkContext: true,
enableAccelerators: true,
enableDoubleClickRename: true,
showToggleFullscreen: true,
};

0 comments on commit b8ef17c

Please sign in to comment.