-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e89192
commit e313e20
Showing
36 changed files
with
377 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,4 @@ export default interface Yeast { | |
name: string; | ||
avg_attn: Scalar; | ||
temp: Scalar; | ||
starter: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import {ScreenH3, ScreenH4} from "@brewdocs.beer/design"; | ||
import {Fragment} from "react"; | ||
import DataGrid from "@/component/data-grid"; | ||
import Hop from "@/model/hop"; | ||
import DataGridRow from "@/component/data-grid/row"; | ||
import DataGridLabel from "@/component/data-grid/label"; | ||
import DataGridLabelNote from "@/component/data-grid/label-note"; | ||
import DataGridInput from "@/component/data-grid/input"; | ||
import Additive from "@/model/additive"; | ||
import Boil from "@/model/boil"; | ||
import {UpdateFn, UpdateScalarFn} from "@/hooks/useJsonEdit"; | ||
import sessionState, {useSession} from "@/state/session"; | ||
import Collapse from "@/component/collapse"; | ||
|
||
export type ScheduleBoilTypes = { | ||
boil: Boil[]; | ||
hops: Hop[]; | ||
additives: Additive[]; | ||
update: UpdateFn; | ||
updateScalar: UpdateScalarFn; | ||
} | ||
export default function ScheduleBoil({ boil, hops, additives, update, updateScalar }: ScheduleBoilTypes) { | ||
const session = useSession(); | ||
|
||
return ( | ||
<> | ||
<Collapse | ||
toggle={(open: boolean) => sessionState.set(`schedule.boil`, open)} | ||
key={"boil"} | ||
title={"2. Boil"} | ||
className="lg:collapse-open" | ||
openInitial={session[`schedule.boil`] ?? true}> | ||
{boil.map((m, i) => ( | ||
<Fragment key={`boil-${m.name}-${i}`}> | ||
<ScreenH4 className="cozy">{m.name} - {m.time.value}</ScreenH4> | ||
<DataGrid> | ||
{hops.map((hop: Hop, i) => ( | ||
<DataGridRow key={`hop-${hop.name}-${i}`}> | ||
<DataGridLabel>{hop.name} <DataGridLabelNote>({hop.alpha.value})</DataGridLabelNote></DataGridLabel> | ||
<DataGridInput readonly value={hop.weight.value} col={2} /> | ||
<DataGridInput | ||
col={3} | ||
value={hop.boil.value} | ||
onChange={(value: string) => update(`hops[${i}].boil`, value)} | ||
onBlur={(value: string) => updateScalar(`hops[${i}].boil`, value)} | ||
/> | ||
</DataGridRow> | ||
))} | ||
</DataGrid> | ||
</Fragment> | ||
))} | ||
{additives.length ? ( | ||
<Fragment> | ||
<ScreenH4>Additives</ScreenH4> | ||
<DataGrid> | ||
{additives.map((additive: Additive, i) => ( | ||
<DataGridRow key={`additive-${additive.name}-${i}`}> | ||
<DataGridLabel>{additive.name}</DataGridLabel> | ||
<DataGridInput | ||
col={3} | ||
value={additive.boil.value} | ||
onChange={(value: string) => update(`additives[${i}].scalar`, value)} | ||
onBlur={(value: string) => updateScalar(`additives[${i}].scalar`, value)} | ||
/> | ||
</DataGridRow> | ||
))} | ||
</DataGrid> | ||
</Fragment> | ||
) : <></>} | ||
</Collapse> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import sessionState, {useSession} from "@/state/session"; | ||
import Collapse from "@/component/collapse"; | ||
|
||
export default function ScheduleChill() { | ||
const session = useSession(); | ||
return ( | ||
<Collapse | ||
toggle={(open: boolean) => sessionState.set(`schedule.chill`, open)} | ||
key={"chill"} | ||
title={"3. Chill"} | ||
className="lg:collapse-open" | ||
openInitial={session[`schedule.chill`] ?? true}> | ||
<p> | ||
It is critical you chill your wort as quickly as possible. Cool you wort to 60°F to 72°F, depending on what your beer style calls for. | ||
</p> | ||
</Collapse> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.