hooked up the mode change stuff for the new summary
This commit is contained in:
parent
f54d4b5375
commit
0f4d706e76
4 changed files with 107 additions and 13 deletions
|
|
@ -3,7 +3,7 @@ import PageContainer from "./PageContainer";
|
|||
import { DevicePreset } from "models/DevicePreset";
|
||||
import { Controller } from "models/Controller";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
import { useMobile } from "hooks";
|
||||
import { useMobile, useSnackbar } from "hooks";
|
||||
import { Component, Device, Bin as IBin, Interaction } from "models";
|
||||
import { useBinAPI, useGlobalState } from "providers";
|
||||
import { pond } from "protobuf-ts/pond";
|
||||
|
|
@ -69,6 +69,7 @@ export default function BinV2(){
|
|||
const [pressures, setPressures] = useState<Pressure[]>([]);
|
||||
const [headspaceCO2, setHeadspaceCO2] = useState<CO2[]>([]);
|
||||
const [heaters, setHeaters] = useState<Controller[]>([]);
|
||||
const {openSnack} = useSnackbar()
|
||||
const [fans, setFans] = useState<Controller[]>([]);
|
||||
const [compositionNameMap, setCompositionNameMap] = useState<Map<string, string>>(new Map());
|
||||
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
||||
|
|
@ -432,7 +433,22 @@ export default function BinV2(){
|
|||
return (
|
||||
<PageContainer>
|
||||
{pageHeader()}
|
||||
<BinSummary bin={bin} devices={devices} fans={fans} heaters={heaters} permissions={permissions} componentDevices={componentDevices} componentMap={components}/>
|
||||
<BinSummary
|
||||
bin={bin}
|
||||
devices={devices}
|
||||
fans={fans}
|
||||
heaters={heaters}
|
||||
permissions={permissions}
|
||||
componentDevices={componentDevices}
|
||||
componentMap={components}
|
||||
binPrefs={preferences}
|
||||
updateBinCallback={(bin) => {
|
||||
setBin(bin)
|
||||
binAPI.updateBin(bin.key(), bin.settings).then(resp => {
|
||||
openSnack("Bin has Been Updated")
|
||||
})
|
||||
}}
|
||||
/>
|
||||
{/* render drawers */}
|
||||
{noteDrawer()}
|
||||
{taskDrawer()}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue