Files
grungnet/src/components/map/MapDice.js

41 lines
1007 B
JavaScript
Raw Normal View History

2020-05-08 15:09:40 +10:00
import React, { useState } from "react";
import { Flex, IconButton } from "theme-ui";
2020-05-08 15:09:40 +10:00
import ExpandMoreDiceIcon from "../../icons/ExpandMoreDiceIcon";
2020-05-27 11:24:17 +10:00
import DiceTrayOverlay from "./dice/DiceTrayOverlay";
function MapDice() {
const [isExpanded, setIsExpanded] = useState(false);
return (
2020-05-08 15:09:40 +10:00
<Flex
sx={{
position: "absolute",
top: 0,
left: 0,
bottom: 0,
2020-05-08 15:09:40 +10:00
flexDirection: "column",
alignItems: "flex-start",
}}
2020-05-08 15:09:40 +10:00
ml={1}
>
2020-05-08 15:09:40 +10:00
<IconButton
aria-label={isExpanded ? "Hide Dice Tray" : "Show Dice Tray"}
title={isExpanded ? "Hide Dice Tray" : "Show Dice Tray"}
onClick={() => setIsExpanded(!isExpanded)}
sx={{
display: "block",
backgroundColor: "overlay",
borderRadius: "50%",
}}
2020-05-08 15:09:40 +10:00
m={2}
>
<ExpandMoreDiceIcon isExpanded={isExpanded} />
2020-05-08 15:09:40 +10:00
</IconButton>
2020-05-27 11:24:17 +10:00
<DiceTrayOverlay isOpen={isExpanded} />
2020-05-08 15:09:40 +10:00
</Flex>
);
}
export default MapDice;