From f3f8f6748f980b9c2699ad0566fa0aef9e1f1443 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sun, 14 Mar 2021 07:57:56 -0700 Subject: [PATCH] [WIP] A better TODO message for the bulk add tool --- .../support/AllItemLayersSupportModal.js | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/app/WardrobePage/support/AllItemLayersSupportModal.js b/src/app/WardrobePage/support/AllItemLayersSupportModal.js index c073ac3..cee7b69 100644 --- a/src/app/WardrobePage/support/AllItemLayersSupportModal.js +++ b/src/app/WardrobePage/support/AllItemLayersSupportModal.js @@ -28,6 +28,8 @@ import { EditIcon } from "@chakra-ui/icons"; import cachedZones from "../../cached-data/zones.json"; function AllItemLayersSupportModal({ item, isOpen, onClose }) { + const [bulkAddProposal, setBulkAddProposal] = React.useState(null); + const { bodyBackground } = useCommonStyles(); return ( @@ -44,7 +46,17 @@ function AllItemLayersSupportModal({ item, isOpen, onClose }) { - + + + {bulkAddProposal ? ( + <> + TODO: Show assets {bulkAddProposal.minAssetId}– + {Number(bulkAddProposal.minAssetId) + 53}, tenatively applied to + zone {bulkAddProposal.zoneId} + + ) : ( + "" + )} @@ -54,13 +66,13 @@ function AllItemLayersSupportModal({ item, isOpen, onClose }) { ); } -function BulkAddBodySpecificAssetsForm() { +function BulkAddBodySpecificAssetsForm({ onSubmit }) { const zones = [...cachedZones].sort((a, b) => `${a.label} (${a.id})`.localeCompare(`${b.label} (${b.id})`) ); const [minAssetId, setMinAssetId] = React.useState(null); - const [selectedZoneId, setSelectedZoneId] = React.useState(zones[0].id); + const [zoneId, setZoneId] = React.useState(zones[0].id); return ( { e.preventDefault(); - alert("TODO!"); + onSubmit({ minAssetId, zoneId }); }} > setSelectedZoneId(e.target.value)} + value={zoneId} + onChange={(e) => setZoneId(e.target.value)} > {zones.map((zone) => (