From ac26455110ac3d62e16e91be3dae5bd04456b387 Mon Sep 17 00:00:00 2001 From: csawatzky Date: Wed, 3 Jun 2026 16:23:01 -0600 Subject: [PATCH] made a new function for the mobile inventory section, since it may differ drastically fomr the desktop rather than just re-size some stuff --- src/bin/binSummary/BinSummary.tsx | 120 +++++++++++++++++++++++++++++- 1 file changed, 118 insertions(+), 2 deletions(-) diff --git a/src/bin/binSummary/BinSummary.tsx b/src/bin/binSummary/BinSummary.tsx index de3f73d..54b7c82 100644 --- a/src/bin/binSummary/BinSummary.tsx +++ b/src/bin/binSummary/BinSummary.tsx @@ -111,7 +111,123 @@ export default function BinSummary(props: Props){ return bin.grainInventory(user) } - const inventorySummary = () => { + const inventorySummaryMobile = () => { + return ( + + + + {/* Grain Type */} + + + Grain Type + + setOpenGrainDialog(true)} + sx={{ + cursor: "pointer", + mt: 0.5, + px: 1, + py: 0.5, + borderRadius: 1, + border: "1px solid", + borderColor: grey[700], + "&:hover": { + borderColor: grey[500], + backgroundColor: "rgba(255,255,255,0.05)", + }, + }} + > + + {bin.grainName()} + + + + {/* Bin Fill */} + + + Bin Fill + + + {/* Top line: current / capacity */} + + {currentFill()} / {bin.grainCapacity(user)} + + {/* Bottom line: bar/slider + percent */} + + {bin.inventoryControl() === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_MANUAL ? ( + setOpenNewTransaction(true)} + onChange={(_, val) => { + let fillPercent = val as number + setManualFillPercent(fillPercent) + setManualBushels((fillPercent / 100) * bin.bushelCapacity()) + }} + min={0} + max={100} + sx={{ + flexGrow: 1, + color: "#4caf50", + "& .MuiSlider-thumb": { width: 16, height: 16 }, + "& .MuiSlider-rail": { backgroundColor: "rgba(255,255,255,0.1)" }, + }} + /> + ) : ( + + )} + + {bin.inventoryControl() === pond.BinInventoryControl.BIN_INVENTORY_CONTROL_MANUAL + ? manualFillPercent + : bin.fillPercent()}% + + + + + + {/* Last Updated */} + + + Last Updated + + + + {/* Top line: time */} + + + + {moment(bin.status.timestamp).fromNow()} + + + {/* Bottom line: live/inactive status */} + + {activity(bin.status.timestamp)} + + + + + + + + ); + } + + const inventorySummaryDesktop = () => { return ( @@ -270,7 +386,7 @@ export default function BinSummary(props: Props){ }} /> setOpenGrainDialog(false)} permissions={permissions} updateBin={updateBinCallback}/> - {inventorySummary()} + {isMobile ? inventorySummaryMobile() : inventorySummaryDesktop()}