aboutsummaryrefslogtreecommitdiff
path: root/src/routes/groceries
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-09-12 22:24:19 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-09-12 22:24:19 +0200
commit5f0a73920034741236034ed7a721c68eceb8ab82 (patch)
treec5653093db0484e7474b9d69941666dfc308b083 /src/routes/groceries
parent1cef356be95a67f95d40f5b0b131f98d11f13c13 (diff)
Extract Row primitive, migrate all call sites
Variants card/ref/plain with scoped skin. Padding and wrap one-offs via style prop; draggable and handlers via rest spread. GroceryRow absorbs item-btn/ref-link globals with local names; BestRef scopes best-ref. Delete item-* globals and dead page overrides.
Diffstat (limited to 'src/routes/groceries')
-rw-r--r--src/routes/groceries/categories/+page.svelte6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/routes/groceries/categories/+page.svelte b/src/routes/groceries/categories/+page.svelte
index 3d6d5b3..c2a3684 100644
--- a/src/routes/groceries/categories/+page.svelte
+++ b/src/routes/groceries/categories/+page.svelte
@@ -2,6 +2,7 @@
import { enhance } from '$app/forms';
import type { Category } from '$lib/server/services/types';
import Button from '$lib/components/Button.svelte';
+ import Row from '$lib/components/Row.svelte';
let { data, form } = $props();
let name = $state('');
@@ -72,8 +73,7 @@
<form method="POST" action="?/delete" use:enhance>
<ul class="item-list">
{#each localCategories as cat, index (cat.id)}
- <li
- class="item-row item-row--card"
+ <Row
draggable="true"
ondragstart={() => handleDragStart(index)}
ondragover={(e) => handleDragOver(e, index)}
@@ -85,7 +85,7 @@
<Button variant="ghost" name="id" value={cat.id} ariaLabel="Supprimer"
>&times;</Button
>
- </li>
+ </Row>
{/each}
</ul>
</form>