mirror of
https://github.com/aljazceru/hypergolic.git
synced 2025-12-19 14:34:20 +01:00
problem: product and purchase layout is misaligned for desktop view
Time spent: 1 hour
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
<script lang="ts">
|
||||
export let title: string;
|
||||
export let title: string | undefined;
|
||||
</script>
|
||||
|
||||
<div class="mb-4 flex items-center">
|
||||
{#if title}
|
||||
<div class="my-4 flex items-center">
|
||||
<h1 class="scroll-m-20 text-xl font-semibold tracking-tight md:text-3xl">
|
||||
{title}
|
||||
</h1>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -46,16 +46,31 @@
|
||||
</script>
|
||||
|
||||
{#if validate(product)}
|
||||
<Card.Root class="m-2 w-[450px]">
|
||||
<Card.Root>
|
||||
<Card.Header>
|
||||
<Card.Title>{product.getMatchingTags('name')[0][1]}</Card.Title>
|
||||
<Card.Description>{product.getMatchingTags('description')[0][1]}</Card.Description>
|
||||
</Card.Header>
|
||||
<img src={product.getMatchingTags('cover')[0][1]} alt="cover" />
|
||||
|
||||
{#if $$slots.default}
|
||||
<Card.Content>
|
||||
<div class="flex flex-col items-center justify-center gap-2 sm:flex-row">
|
||||
<img
|
||||
src={product.getMatchingTags('cover')[0][1]}
|
||||
alt="cover"
|
||||
class="aspect-square w-[200px] object-cover"
|
||||
/>
|
||||
<slot />
|
||||
</div>
|
||||
</Card.Content>
|
||||
<Card.Footer class="flex justify-between">
|
||||
{:else}
|
||||
<img
|
||||
src={product.getMatchingTags('cover')[0][1]}
|
||||
alt="cover"
|
||||
class="aspect-square object-cover"
|
||||
/>
|
||||
{/if}
|
||||
<Card.Footer class="flex justify-between pt-2">
|
||||
{#if !includedInRocket()}
|
||||
<AddProductToRocket {product} {rocket} />
|
||||
{:else}
|
||||
|
||||
@@ -24,15 +24,19 @@
|
||||
<Card.Root class="sm:col-span-3">
|
||||
<Card.Header class="pb-3">
|
||||
<Card.Title>Products and Purchases</Card.Title>
|
||||
<Card.Description class="grid grid-cols-2">
|
||||
<Card.Description></Card.Description>
|
||||
</Card.Header>
|
||||
<Card.Content
|
||||
class="grid gap-2"
|
||||
style="grid-template-columns: repeat(auto-fit, minmax(min(100% - 2rem, 400px), 1fr));"
|
||||
>
|
||||
{#each $products as product}
|
||||
<div class="grid-cols-1">
|
||||
<div>
|
||||
<ProductCardFromId {rocket} productID={product.ID}>
|
||||
<ProductPurchases {rocket} {product} />
|
||||
</ProductCardFromId>
|
||||
</div>
|
||||
{/each}
|
||||
</Card.Description>
|
||||
</Card.Header>
|
||||
</Card.Content>
|
||||
<Card.Footer></Card.Footer>
|
||||
</Card.Root>
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
</script>
|
||||
|
||||
{#if $purchases.size > 0}
|
||||
<div class="pt-2 text-lg font-semibold">Purchases</div>
|
||||
<Table.Root>
|
||||
<Table.Header>
|
||||
<Table.Row>
|
||||
|
||||
@@ -46,8 +46,10 @@
|
||||
{#if productsToRender && $productsToRender}
|
||||
{#each $productsToRender as [r, p]}
|
||||
<Heading title={r.dTag} />
|
||||
<div class="grid gap-2" style="grid-template-columns: repeat(auto-fit, 350px);">
|
||||
{#each p as product}
|
||||
<ProductCard {product} rocket={r} />
|
||||
{/each}
|
||||
</div>
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user