diff --git a/src/components/map/MapControls.js b/src/components/map/MapControls.js index ca46ae1..94b36a4 100644 --- a/src/components/map/MapControls.js +++ b/src/components/map/MapControls.js @@ -16,6 +16,10 @@ import BrushToolIcon from "../../icons/BrushToolIcon"; import MeasureToolIcon from "../../icons/MeasureToolIcon"; import ExpandMoreIcon from "../../icons/ExpandMoreIcon"; import PointerToolIcon from "../../icons/PointerToolIcon"; +import FullScreenIcon from "../../icons/FullScreenIcon"; +import FullScreenExitIcon from "../../icons/FullScreenExitIcon"; + +import useSetting from "../../helpers/useSetting"; function MapContols({ onMapChange, @@ -31,6 +35,7 @@ function MapContols({ disabledSettings, }) { const [isExpanded, setIsExpanded] = useState(true); + const [fullScreen, setFullScreen] = useSetting("map.fullScreen"); const toolsById = { pan: { @@ -190,6 +195,24 @@ function MapContols({ {controls} {getToolSettings()} + + setFullScreen(!fullScreen)} + aria-label={fullScreen ? "Exit Full Screen" : "Enter Full Screen"} + title={fullScreen ? "Exit Full Screen" : "Enter Full Screen"} + > + {fullScreen ? : } + + ); } diff --git a/src/components/party/DiceTrayButton.js b/src/components/party/DiceTrayButton.js index 475324a..96679db 100644 --- a/src/components/party/DiceTrayButton.js +++ b/src/components/party/DiceTrayButton.js @@ -6,6 +6,8 @@ import DiceTrayOverlay from "../dice/DiceTrayOverlay"; import { DiceLoadingProvider } from "../../contexts/DiceLoadingContext"; +import useSetting from "../../helpers/useSetting"; + function DiceTrayButton({ shareDice, onShareDiceChage, @@ -13,13 +15,14 @@ function DiceTrayButton({ onDiceRollsChange, }) { const [isExpanded, setIsExpanded] = useState(false); + const [fullScreen] = useSetting("map.fullScreen"); return ( - - Party - - - - - {Object.entries(partyNicknames).map(([id, partyNickname]) => ( + + + Party + + + - ))} - {timer && } - {Object.entries(partyTimers).map(([id, partyTimer], index) => ( - ( + + ))} + {timer && } + {Object.entries(partyTimers).map(([id, partyTimer], index) => ( + + ))} + + + - ))} - - - - - - - - + + + + + + - + ); } diff --git a/src/components/token/Tokens.js b/src/components/token/Tokens.js index bd40ae4..ae9b8b6 100644 --- a/src/components/token/Tokens.js +++ b/src/components/token/Tokens.js @@ -9,6 +9,7 @@ import ProxyToken from "./ProxyToken"; import SelectTokensButton from "./SelectTokensButton"; import { fromEntries } from "../../helpers/shared"; +import useSetting from "../../helpers/useSetting"; import AuthContext from "../../contexts/AuthContext"; import TokenDataContext from "../../contexts/TokenDataContext"; @@ -18,6 +19,7 @@ const listTokenClassName = "list-token"; function Tokens({ onMapTokenStateCreate }) { const { userId } = useContext(AuthContext); const { ownedTokens, tokens } = useContext(TokenDataContext); + const [fullScreen] = useSetting("map.fullScreen"); function handleProxyDragEnd(isOnMap, token) { if (isOnMap && onMapTokenStateCreate) { @@ -48,6 +50,7 @@ function Tokens({ onMapTokenStateCreate }) { width: "80px", minWidth: "80px", overflow: "hidden", + display: fullScreen ? "none" : "block", }} > diff --git a/src/icons/FullScreenExitIcon.js b/src/icons/FullScreenExitIcon.js new file mode 100644 index 0000000..7e23c78 --- /dev/null +++ b/src/icons/FullScreenExitIcon.js @@ -0,0 +1,18 @@ +import React from "react"; + +function FullScreenIcon() { + return ( + + + + + ); +} + +export default FullScreenIcon; diff --git a/src/icons/FullScreenIcon.js b/src/icons/FullScreenIcon.js new file mode 100644 index 0000000..0abc848 --- /dev/null +++ b/src/icons/FullScreenIcon.js @@ -0,0 +1,18 @@ +import React from "react"; + +function FullScreenIcon() { + return ( + + + + + ); +} + +export default FullScreenIcon; diff --git a/src/settings.js b/src/settings.js index 214a00a..e526c36 100644 --- a/src/settings.js +++ b/src/settings.js @@ -27,6 +27,7 @@ function loadVersions(settings) { style: "galaxy", }, })); + settings.version(2, (prev) => ({ ...prev, map: { fullScreen: false } })); } export function getSettings() {