diff --git a/src/components/Tile.js b/src/components/Tile.js index 238ccd8..66d5ddc 100644 --- a/src/components/Tile.js +++ b/src/components/Tile.js @@ -119,4 +119,17 @@ function Tile({ ); } +Tile.defaultProps = { + src: "", + title: "", + isSelected: false, + onSelect: () => {}, + onEdit: () => {}, + onDoubleClick: () => {}, + large: false, + canEdit: false, + badges: [], + editTitle: "Edit", +}; + export default Tile; diff --git a/src/components/dice/DiceTile.js b/src/components/dice/DiceTile.js index 7cf26d3..8491c3b 100644 --- a/src/components/dice/DiceTile.js +++ b/src/components/dice/DiceTile.js @@ -1,74 +1,17 @@ import React from "react"; -import { Flex, Image, Text, Box } from "theme-ui"; + +import Tile from "../Tile"; function DiceTile({ dice, isSelected, onDiceSelect, onDone, large }) { return ( - onDiceSelect(dice)} - sx={{ - position: "relative", - width: large ? "48%" : "32%", - height: "0", - paddingTop: large ? "48%" : "32%", - borderRadius: "4px", - justifyContent: "center", - alignItems: "center", - cursor: "pointer", - }} - my={1} - mx={`${large ? 1 : 2 / 3}%`} - bg="muted" + onDiceSelect(dice)} onDoubleClick={() => onDone(dice)} - > - - - - {dice.name} - - - - + large={large} + /> ); } diff --git a/src/components/map/MapTile.js b/src/components/map/MapTile.js index 299e48e..4f155ce 100644 --- a/src/components/map/MapTile.js +++ b/src/components/map/MapTile.js @@ -37,6 +37,7 @@ function MapTile({ large={large} canEdit={canEdit} badges={badges} + editTitle="Edit Map" /> ); }