Remove product dropdown picker and step headers. Entry is now scan-a-SKU or create-a-new-product only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -62,11 +62,11 @@ export function AddInventoryFlow({ data, onClose }: { data: Bootstrap; onClose:
|
||||
: "Saved"
|
||||
}
|
||||
eyebrow={
|
||||
step === "select"
|
||||
? "Step 1 · Scan or pick a product"
|
||||
: step === "details"
|
||||
? "Step 2 · This batch's details"
|
||||
: "Inventory item created"
|
||||
step === "details"
|
||||
? "Batch details"
|
||||
: step === "done"
|
||||
? "Inventory item created"
|
||||
: ""
|
||||
}
|
||||
onClose={onClose}
|
||||
/>
|
||||
@@ -128,9 +128,6 @@ function SelectProductStep({
|
||||
const qc = useQueryClient();
|
||||
|
||||
const [creating, setCreating] = useState(false);
|
||||
const [pickedProductId, setPickedProductId] = useState<string>(
|
||||
data.products[0]?.id ?? "",
|
||||
);
|
||||
|
||||
// New-product subform
|
||||
const [newSku, setNewSku] = useState("");
|
||||
@@ -213,27 +210,6 @@ function SelectProductStep({
|
||||
matchedLabel={null}
|
||||
/>
|
||||
|
||||
{data.products.length > 0 && !creating && (
|
||||
<div style={{ marginTop: 16 }}>
|
||||
<Field label="Or pick an existing product">
|
||||
<Select
|
||||
value={pickedProductId}
|
||||
onChange={(e) => setPickedProductId(e.target.value)}
|
||||
>
|
||||
{data.products.map((p) => {
|
||||
const strainName =
|
||||
data.strains.find((s) => s.id === p.strainId)?.name ?? "?";
|
||||
return (
|
||||
<option key={p.id} value={p.id}>
|
||||
{strainName} · {p.sku} ({p.type})
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
</Select>
|
||||
</Field>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!creating && (
|
||||
<div style={{ marginTop: 18 }}>
|
||||
<Btn variant="ghost" icon="plus" onClick={() => setCreating(true)}>
|
||||
@@ -322,13 +298,13 @@ function SelectProductStep({
|
||||
<div style={{ fontSize: 12, color: "var(--ink-3)" }}>
|
||||
{creating
|
||||
? "Create the product, then we'll capture this batch's details."
|
||||
: "Scan a SKU, pick a product, or create one."}
|
||||
: "Scan a SKU barcode, or create a new product."}
|
||||
</div>
|
||||
<div style={{ display: "flex", gap: 8 }}>
|
||||
<Btn variant="ghost" onClick={onClose}>
|
||||
Cancel
|
||||
</Btn>
|
||||
{creating ? (
|
||||
{creating && (
|
||||
<>
|
||||
<Btn variant="ghost" onClick={() => setCreating(false)}>
|
||||
Back
|
||||
@@ -342,17 +318,6 @@ function SelectProductStep({
|
||||
{create.isPending ? "Creating…" : "Create product"}
|
||||
</Btn>
|
||||
</>
|
||||
) : (
|
||||
data.products.length > 0 && (
|
||||
<Btn
|
||||
variant="primary"
|
||||
icon="plus"
|
||||
disabled={!pickedProductId}
|
||||
onClick={() => onPickProduct(pickedProductId)}
|
||||
>
|
||||
Add inventory
|
||||
</Btn>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
</ModalFooter>
|
||||
|
||||
@@ -102,9 +102,11 @@ export function ModalHeader({
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
{eyebrow && (
|
||||
<div className="smallcaps" style={{ color: eyebrowColor ?? "var(--ink-3)" }}>
|
||||
{eyebrow}
|
||||
</div>
|
||||
)}
|
||||
<h2 className="serif" style={{ fontSize: 28, margin: "4px 0 0", fontWeight: 500 }}>
|
||||
{title}
|
||||
</h2>
|
||||
|
||||
Reference in New Issue
Block a user