-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial work for managing categories * Separate categories into it's own page * Wrap up shop categories
- Loading branch information
Showing
23 changed files
with
3,427 additions
and
2,021 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,32 +1,36 @@ | ||
<script lang="ts"> | ||
import type { components } from '$lib/api/api'; | ||
import { cn } from '$lib/utils'; | ||
import ProductPrice from './product-price.svelte'; | ||
import Package from 'lucide-svelte/icons/package'; | ||
interface Props { | ||
product: components['schemas']['ProductDto']; | ||
class?: string; | ||
} | ||
let { product }: Props = $props(); | ||
let { product, class: className = '' }: Props = $props(); | ||
let image = $derived(product.thumbnail?.url ?? ''); | ||
</script> | ||
|
||
<a | ||
class="m-1 inline-block max-w-64 rounded-md bg-primary-foreground shadow-primary hover:drop-shadow-lg" | ||
class={cn('inline-block max-w-64 rounded-md bg-primary-foreground shadow-primary hover:drop-shadow-lg', className)} | ||
href="/shop/{product.id}" | ||
> | ||
<div class="flex min-w-0 flex-col items-center justify-start gap-4"> | ||
<div class="flex min-w-0 flex-col items-center justify-start"> | ||
<div class="grid min-h-32 w-full items-center justify-center rounded-md drop-shadow-lg"> | ||
{#if image} | ||
<img src={image} alt={product.name} class="h-32 w-32 rounded-sm object-cover" /> | ||
{:else} | ||
<Package size={64} /> | ||
{/if} | ||
<div class="absolute bottom-0 right-0 mb-1 mr-2 rounded-md shadow-primary-foreground drop-shadow-md"> | ||
<ProductPrice {product} /> | ||
</div> | ||
</div> | ||
<div class="flex flex-row justify-between gap-2 px-2 pb-2 pt-1"> | ||
<p class="overflow-hidden text-ellipsis pr-4 text-xl">{product.name}</p> | ||
<ProductPrice {product} /> | ||
<div class="flex flex-row items-start justify-center gap-2 p-2 px-1"> | ||
<p class="overflow-hidden text-ellipsis text-xl">{product.name}</p> | ||
</div> | ||
</div> | ||
</a> |
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
Oops, something went wrong.