diff --git a/src/components/tile/Tile.js b/src/components/tile/Tile.js index 8ee58a5..610c19e 100644 --- a/src/components/tile/Tile.js +++ b/src/components/tile/Tile.js @@ -83,13 +83,25 @@ function Tile({ borderRadius: "4px", }} /> - + {badges.map((badge, i) => ( - + {badge} ))} - + {canEdit && ( token.id); - await updateTokens(selectedTokenIds, { hideInSidebar }); - onLoad(false); + updateTokensHidden(selectedTokenIds, hideInSidebar); } /** diff --git a/src/components/token/TokenHiddenBadge.js b/src/components/token/TokenHiddenBadge.js new file mode 100644 index 0000000..a7d633f --- /dev/null +++ b/src/components/token/TokenHiddenBadge.js @@ -0,0 +1,21 @@ +import React from "react"; +import { Flex } from "theme-ui"; + +import TokenShowIcon from "../../icons/TokenShowIcon"; +import TokenHideIcon from "../../icons/TokenHideIcon"; + +function TokenHiddenBadge({ hidden }) { + return ( + + {hidden ? : } + + ); +} + +export default TokenHiddenBadge; diff --git a/src/components/token/TokenTiles.js b/src/components/token/TokenTiles.js index 26df7f3..3b4e817 100644 --- a/src/components/token/TokenTiles.js +++ b/src/components/token/TokenTiles.js @@ -2,6 +2,7 @@ import React from "react"; import TokenTile from "./TokenTile"; import TokenTileGroup from "./TokenTileGroup"; +import TokenHiddenBadge from "./TokenHiddenBadge"; import SortableTiles from "../tile/SortableTiles"; @@ -35,7 +36,10 @@ function TokenTiles({ tokens, onTokenEdit, subgroup }) { onSelect={onGroupSelect} onTokenEdit={onTokenEdit} canEdit={canEdit} - badges={[`${token.defaultSize}x`]} + badges={[ + `${token.defaultSize}x`, +