Fix rendering of sub groups in group tiles
This commit is contained in:
parent
f496adae1d
commit
549ecbf65a
@ -14,7 +14,11 @@ import SortableTiles from "../drag/SortableTiles";
|
||||
|
||||
import useResponsiveLayout from "../../hooks/useResponsiveLayout";
|
||||
|
||||
import { groupsFromIds, itemsFromGroups } from "../../helpers/select";
|
||||
import {
|
||||
groupsFromIds,
|
||||
itemsFromGroups,
|
||||
getGroupItems,
|
||||
} from "../../helpers/select";
|
||||
|
||||
function MapTiles({
|
||||
maps,
|
||||
@ -90,13 +94,12 @@ function MapTiles({
|
||||
);
|
||||
} else {
|
||||
const isSelected = selectedGroupIds.includes(group.id);
|
||||
const items = getGroupItems(group);
|
||||
return (
|
||||
<MapTileGroup
|
||||
key={group.id}
|
||||
group={group}
|
||||
maps={group.items.map((item) =>
|
||||
maps.find((map) => map.id === item.id)
|
||||
)}
|
||||
maps={items.map((item) => maps.find((map) => map.id === item.id))}
|
||||
isSelected={isSelected}
|
||||
onSelect={onTileSelect}
|
||||
/>
|
||||
|
@ -15,7 +15,11 @@ import SortableTiles from "../drag/SortableTiles";
|
||||
|
||||
import useResponsiveLayout from "../../hooks/useResponsiveLayout";
|
||||
|
||||
import { groupsFromIds, itemsFromGroups } from "../../helpers/select";
|
||||
import {
|
||||
groupsFromIds,
|
||||
itemsFromGroups,
|
||||
getGroupItems,
|
||||
} from "../../helpers/select";
|
||||
|
||||
function TokenTiles({
|
||||
tokens,
|
||||
@ -70,11 +74,12 @@ function TokenTiles({
|
||||
);
|
||||
} else {
|
||||
const isSelected = selectedGroupIds.includes(group.id);
|
||||
const items = getGroupItems(group);
|
||||
return (
|
||||
<TokenTileGroup
|
||||
key={group.id}
|
||||
group={group}
|
||||
tokens={group.items.map((item) =>
|
||||
tokens={items.map((item) =>
|
||||
tokens.find((token) => token.id === item.id)
|
||||
)}
|
||||
isSelected={isSelected}
|
||||
|
Loading…
Reference in New Issue
Block a user