From 1eed2eb15d30e6dde2213e9c5ce92801bdbd4ce4 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Sat, 12 Jun 2021 21:25:03 +1000 Subject: [PATCH] Fix token preview rendering for token groups --- src/components/map/MapTileGroup.js | 21 +++++++++++++-------- src/components/token/TokenBarTokenGroup.js | 9 +++++++-- src/components/token/TokenImage.js | 2 +- src/components/token/TokenTileGroup.js | 22 ++++++++++++++-------- 4 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/components/map/MapTileGroup.js b/src/components/map/MapTileGroup.js index f556844..753fc63 100644 --- a/src/components/map/MapTileGroup.js +++ b/src/components/map/MapTileGroup.js @@ -19,15 +19,20 @@ function MapTileGroup({ group, maps, isSelected, onSelect, onDoubleClick }) { - {maps.slice(0, 9).map((map) => ( - - ))} + {maps + .slice(0, layout.groupGridColumns * layout.groupGridColumns) + .map((map) => ( + + ))} ); diff --git a/src/components/token/TokenBarTokenGroup.js b/src/components/token/TokenBarTokenGroup.js index ecfce81..d673ec1 100644 --- a/src/components/token/TokenBarTokenGroup.js +++ b/src/components/token/TokenBarTokenGroup.js @@ -70,11 +70,16 @@ function TokenBarTokenGroup({ group, tokens, draggable }) { } else { return ( { - {tokens.slice(0, 9).map((token) => ( - - ))} + {tokens + .slice(0, layout.groupGridColumns * layout.groupGridColumns) + .map((token) => ( + + ))} );