feat: improved on ui so that user can see the spaces they want to view easier #33

Merged
ca422 merged 5 commits from feat/study-card-visual-improvements into master 2025-06-05 11:03:37 +00:00
3 changed files with 26 additions and 17 deletions
Showing only changes of commit 6e72580a6a - Show all commits

View File

@@ -1,22 +1,21 @@
<script lang="ts"> <script lang="ts">
import type { Snippet } from "svelte"; import type { Table } from "@supabase/supabase-js";
interface Props { interface Props {
space: Table<"study_spaces">;
alt: string; alt: string;
imgSrc: string; imgSrc: string;
title?: Snippet;
description?: Snippet;
href?: string; href?: string;
} }
const { alt, imgSrc, title, description, href }: Props = $props(); const { space, alt, imgSrc, href }: Props = $props();
</script> </script>
<a class="card" {href}> <a class="card" {href}>
<img src={imgSrc} {alt} /> <img src={imgSrc} {alt} />
<div class="description"> <div class="description">
{@render title?.()} <h1>{space.location}</h1>
{@render description?.()} <p>{space.description}</p>
</div> </div>
</a> </a>

View File

@@ -26,15 +26,8 @@
alt="Photo of {studySpace.description}" alt="Photo of {studySpace.description}"
href="/space/{studySpace.id}" href="/space/{studySpace.id}"
imgSrc={imgUrl} imgSrc={imgUrl}
> space={studySpace}
{#snippet title()} />
<h1>{studySpace.location}</h1>
{/snippet}
{#snippet description()}
<p>{studySpace.description}</p>
{/snippet}
</SpaceCard>
{/each} {/each}
</main> </main>