From 7dfd583c7c657b3affd0cc1dbdbef5f82932c90b Mon Sep 17 00:00:00 2001 From: june Date: Tue, 12 Aug 2025 17:57:13 +1200 Subject: [PATCH] Add some basic styling --- src/components/Card/OverviewCard.astro | 18 ++++++++++++++++++ src/pages/index.astro | 20 +++++++++++++------- src/styles/global.css | 2 +- 3 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 src/components/Card/OverviewCard.astro diff --git a/src/components/Card/OverviewCard.astro b/src/components/Card/OverviewCard.astro new file mode 100644 index 0000000..6736237 --- /dev/null +++ b/src/components/Card/OverviewCard.astro @@ -0,0 +1,18 @@ +--- +import client from "@/data/pocketbase" +const { recipe } = Astro.props; + +const headerImage = await client.collection("images").getOne(recipe.images[0]) +const image = await client.files.getURL(headerImage, headerImage.image) +--- + +
+ + +
+

{recipe.name}

+
+
\ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index dcdb6d2..a167e15 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,16 +1,22 @@ --- import PageLayout from "@/layouts/base" -import { client } from "@/data/pocketbase" +import client from "@/data/pocketbase" +import OverviewCard from "@/components/Card/OverviewCard" -const reccies = await client.collection("recipes").getFullList() +const recipies = await client.collection("recipes").getFullList() ---

Recipie

- { - reccies.map(rec => ( -

{rec.name}

- )) - } + What would you like today? + +
+ { + recipies.map(r => ( + + )) + } +
+
diff --git a/src/styles/global.css b/src/styles/global.css index 3330e7e..af41d49 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -1,6 +1,6 @@ @import "tailwindcss"; html { - @apply bg-[#fefefe]; + @apply bg-white; @apply p-5; } \ No newline at end of file