[PIE-17] Design refinements and improvements #8

Merged
breadone merged 4 commits from PIE-17 into main 2025-08-13 19:24:10 +12:00
2 changed files with 31 additions and 2 deletions
Showing only changes of commit ab068ee898 - Show all commits

View File

@ -0,0 +1,17 @@
---
import client from "@/data/pocketbase";
const { ingredients, class: className } = Astro.props;
const ings = await Promise.all(
ingredients.map(async i => await client.collection("ingredients").getOne(i))
)
---
<div class={className}>
{ings.map(i => (
<div>
<p>• {i.quantity} {i.unit || " "} {i.name}</p>
</div>
))}
</div>

View File

@ -1,13 +1,25 @@
---
import { record } from "astro:schema"
import client from "@/data/pocketbase"
import StepIngredientSideView from "./StepIngredientSideView.astro"
const { steps } = Astro.props
---
<div class="md:ml-5 mt-2 md:mt-0">
<p class="text-[22pt] font-bold md:hidden">Steps</p>
{ steps.map(s => (
<div class="bg-[#2a2b2c] rounded-lg mb-2 p-3 md:">
<div class="bg-[#2a2b2c] rounded-lg mb-2 p-3">
<p class="text-bold text-[10pt]">Step {s.index + 1}</p>
<p>{s.instruction}</p>
<div class="flex flex-col md:flex-row md:items-stretch">
<p class="w-full md:flex-2/3 pr-1 text-left">{s.instruction}</p>
{s.ingredients && s.ingredients.length > 0 && (
<div class="w-full md:w-auto md:flex-1/3 mt-2 md:mt-0 md:ml-2 md:pl-3 md:border-l text-white/70 border-white/70">
<StepIngredientSideView class="text-left" ingredients={s.ingredients} />
</div>
)}
</div>
</div>
)) }
</div>