Add back tile search and action bar

This commit is contained in:
Mitchell McCaffrey
2021-06-05 16:38:01 +10:00
parent d6b6d6a1eb
commit e3353c1c44
11 changed files with 161 additions and 83 deletions

View File

@@ -6,18 +6,11 @@ import { useGroup } from "../../contexts/GroupContext";
import { findGroup } from "../../helpers/group";
function SelectMapSelectButton({ onMapSelect, disabled }) {
const {
groups: allGroups,
selectedGroupIds,
openGroupId,
openGroupItems,
} = useGroup();
const groups = openGroupId ? openGroupItems : allGroups;
const { activeGroups, selectedGroupIds } = useGroup();
function handleSelectClick() {
if (selectedGroupIds.length === 1) {
const group = findGroup(groups, selectedGroupIds[0]);
const group = findGroup(activeGroups, selectedGroupIds[0]);
if (group && group.type === "item") {
onMapSelect(group.id);
}