Enhance routing and layout in SvelteKit project by adding new routes for accounts and transactions, updating existing routes, and improving layout parameters. Refactor item handling and integrate barcode scanning functionality for better user experience.
This commit is contained in:
+22
-7
@@ -2,29 +2,44 @@
|
||||
import { browser } from "$app/environment";
|
||||
import { Button } from "$lib/components/ui/button";
|
||||
|
||||
let { data }: { data: { itemsForParent: { id: string; Item: string; SKU: string }[] } } = $props();
|
||||
let { data }: { data: { items: { id: string; SKU?: string }[]; itemsForParent: { id: string; Item: string; SKU: string }[] } } = $props();
|
||||
</script>
|
||||
|
||||
{#if browser}
|
||||
{#await import("./HomeWithDialog.svelte")}
|
||||
<main class="flex min-h-screen flex-col items-center justify-center gap-6 p-8">
|
||||
<main class="flex min-h-screen flex-col items-center justify-center gap-6 p-6 sm:p-8">
|
||||
<p class="text-muted-foreground">Loading…</p>
|
||||
</main>
|
||||
{:then { default: HomeWithDialog }}
|
||||
<HomeWithDialog data={data} />
|
||||
{/await}
|
||||
{:else}
|
||||
<main class="flex min-h-screen flex-col items-center justify-center gap-6 p-8">
|
||||
<main class="flex min-h-screen flex-col items-center justify-center gap-6 p-6 sm:p-8">
|
||||
<h1 class="text-2xl font-semibold">Stackq</h1>
|
||||
<div class="flex w-full max-w-xs flex-col gap-3">
|
||||
<a href="/items" class="block">
|
||||
<Button class="h-12 w-full min-h-12">Scan</Button>
|
||||
</a>
|
||||
<a href="/transactions" class="block">
|
||||
<Button class="h-12 min-h-12 w-full" variant="outline">New Transaction</Button>
|
||||
</a>
|
||||
<a href="/items" class="block">
|
||||
<Button class="h-12 min-h-12 w-full" variant="outline">New Item</Button>
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-muted-foreground w-full max-w-xs border-t pt-4 text-center text-sm">Go to</div>
|
||||
<div class="flex w-full max-w-xs flex-col gap-2">
|
||||
<a href="/items" class="block">
|
||||
<Button class="w-full">Items table</Button>
|
||||
<Button class="h-12 min-h-12 w-full" variant="outline">Items</Button>
|
||||
</a>
|
||||
<a href="/items" class="block">
|
||||
<Button class="w-full" variant="outline">New item</Button>
|
||||
<a href="/transactions" class="block">
|
||||
<Button class="h-12 min-h-12 w-full" variant="outline">Transactions</Button>
|
||||
</a>
|
||||
<a href="/accounts" class="block">
|
||||
<Button class="h-12 min-h-12 w-full" variant="outline">Accounts</Button>
|
||||
</a>
|
||||
<a href="/logout" class="block">
|
||||
<Button class="w-full" variant="outline">Log out</Button>
|
||||
<Button class="h-12 min-h-12 w-full" variant="outline">Log out</Button>
|
||||
</a>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user