Skip to content

Commit

Permalink
remove readings for now
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-whitaker committed Dec 15, 2024
1 parent b96ef5b commit cd18e1e
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 31 deletions.
71 changes: 42 additions & 29 deletions packages/app/src/screen/schedule/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,54 @@ export default function BrewDay({ batch, onChange }: BrewDayProps) {
<ScreenTwoCol>
<ScreenH1 className="col-start-1 lg:col-span-2 col-span-1 mb-2">Brew Schedule</ScreenH1>
<div>
<ScheduleMash grains={data.grains} mash={data.mash} />
<ScheduleBoil boil={data.boil} hops={data.hops} additives={data.additives} update={update} updateScalar={updateScalar} />
<ScheduleMash
grains={data.grains}
mash={data.mash}
hydro={data.hydrometer[0]}
hydroIndex={0}
update={update}
updateScalar={updateScalar}
/>
<ScheduleBoil
boil={data.boil}
hops={data.hops}
additives={data.additives}
update={update}
updateScalar={updateScalar}
/>
</div>
<div>
<ScheduleChill />
<SchedulePitch yeast={data.yeast} update={update} updateScalar={updateScalar} />
</div>
</ScreenTwoCol>
<ScreenTwoCol>
<ScreenH1 className="col-start-1 lg:col-span-2 col-span-1 mb-2">Measurements</ScreenH1>
<div>
<ScreenH3>Gravity Readings</ScreenH3>
<DataGrid>
{data.hydrometer.map((hydro: Hydrometer, i) => (
<DataGridRow key={`hydro-${hydro.name}-${i}`}>
<DataGridLabel>
<DataGridInput
col={1}
type="date"
value={hydro.date}
onChange={(value: string) => update(`hydrometer[${i}].date`, value)}
/>
</DataGridLabel>
<DataGridInput
col={3}
value={hydro.gravity.value}
onChange={(value: string) => update(`hydrometer[${i}].gravity.value`, value)}
onBlur={(value: string) => updateScalar(`hydrometer[${i}].gravity`, value)}
/>
</DataGridRow>
))}
</DataGrid>
</div>
<div></div>
</ScreenTwoCol>
{/*<ScreenTwoCol>*/}
{/* <ScreenH1 className="col-start-1 lg:col-span-2 col-span-1 mb-2">Measurements</ScreenH1>*/}
{/* <div>*/}
{/* <ScreenH3>Gravity Readings</ScreenH3>*/}
{/* <DataGrid>*/}
{/* {data.hydrometer.map((hydro: Hydrometer, i) => (*/}
{/* <DataGridRow key={`hydro-${hydro.name}-${i}`}>*/}
{/* <DataGridLabel>*/}
{/* <DataGridInput*/}
{/* col={1}*/}
{/* type="date"*/}
{/* value={hydro.date}*/}
{/* onChange={(value: string) => update(`hydrometer[${i}].date`, value)}*/}
{/* />*/}
{/* </DataGridLabel>*/}
{/* <DataGridInput*/}
{/* col={3}*/}
{/* value={hydro.gravity.value}*/}
{/* onChange={(value: string) => update(`hydrometer[${i}].gravity.value`, value)}*/}
{/* onBlur={(value: string) => updateScalar(`hydrometer[${i}].gravity`, value)}*/}
{/* />*/}
{/* </DataGridRow>*/}
{/* ))}*/}
{/* </DataGrid>*/}
{/* </div>*/}
{/* <div></div>*/}
{/*</ScreenTwoCol>*/}
</>
)
}
33 changes: 31 additions & 2 deletions packages/app/src/screen/schedule/mash.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ScreenH4} from "@brewdocs.beer/design";
import {ScreenH3, ScreenH4, ScreenH5} from "@brewdocs.beer/design";
import {Fragment} from "react";
import DataGrid from "@/component/data-grid";
import Grain from "@/model/grain";
Expand All @@ -9,13 +9,19 @@ import DataGridInput from "@/component/data-grid/input";
import sessionState, {useSession} from "@/state/session";
import Collapse from "@/component/collapse";
import {Mash} from "@/model/mash";
import Hydrometer from "@/model/hydrometer";
import {UpdateFn, UpdateScalarFn} from "@/hooks/useJsonEdit";

export type ScheduleMashProps = {
mash: Mash[];
grains: Grain[];
update: UpdateFn;
updateScalar: UpdateScalarFn;
hydro: Hydrometer;
hydroIndex: number;
};

export default function ScheduleMash({ mash, grains }: ScheduleMashProps) {
export default function ScheduleMash({ mash, grains, update, updateScalar, hydro, hydroIndex }: ScheduleMashProps) {
const session = useSession();

return (
Expand All @@ -39,6 +45,29 @@ export default function ScheduleMash({ mash, grains }: ScheduleMashProps) {
</DataGrid>
</Fragment>
))}
<div className="divider"></div>
<ScreenH5>Gravity Reading</ScreenH5>
<DataGrid>
<DataGridRow key={`hydro-${hydro.name}-${hydroIndex}`}>
<DataGridLabel>
<DataGridInput
col={1}
type="date"
value={hydro.date}
onChange={(value: string) => update(`hydrometer[${hydroIndex}].date`, value)}
/>
</DataGridLabel>
<DataGridInput
col={3}
value={hydro.gravity.value}
onChange={(value: string) => update(`hydrometer[${hydroIndex}].gravity.value`, value)}
onBlur={(value: string) => updateScalar(`hydrometer[${hydroIndex}].gravity`, value)}
/>
</DataGridRow>
{/*{data.hydrometer.map((hydro: Hydrometer, i) => (*/}
{/* */}
{/*))}*/}
</DataGrid>
</Collapse>
</>
)
Expand Down

0 comments on commit cd18e1e

Please sign in to comment.