From e62bed9153cef4b545879c2089832ab3d8a71569 Mon Sep 17 00:00:00 2001 From: VaiTon Date: Mon, 20 Nov 2023 22:28:05 +0100 Subject: [PATCH] Added button for barcode scan --- package.json | 2 ++ pnpm-lock.yaml | 22 ++++++++++++++++++++++ src/app.html | 23 +++++++++++++---------- src/routes/+error.svelte | 19 +++++++------------ src/routes/+layout.svelte | 33 +++++++++++++++++++-------------- src/routes/+page.svelte | 16 +++++++++------- src/routes/+page.ts | 8 +++++--- tailwind.config.js | 5 ++++- 8 files changed, 81 insertions(+), 47 deletions(-) diff --git a/package.json b/package.json index 872d0cf..343206b 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,8 @@ "format": "prettier --write ." }, "devDependencies": { + "@iconify-json/mdi": "^1.1.55", + "@iconify/tailwind": "^0.1.3", "@sveltejs/adapter-auto": "^2.1.1", "@sveltejs/kit": "^1.27.5", "@tailwindcss/typography": "^0.5.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c4df149..6b9b6cb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,12 @@ settings: excludeLinksFromLockfile: false devDependencies: + '@iconify-json/mdi': + specifier: ^1.1.55 + version: 1.1.55 + '@iconify/tailwind': + specifier: ^0.1.3 + version: 0.1.3 '@sveltejs/adapter-auto': specifier: ^2.1.1 version: 2.1.1(@sveltejs/kit@1.27.5) @@ -364,6 +370,22 @@ packages: resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} dev: true + /@iconify-json/mdi@1.1.55: + resolution: {integrity: sha512-ycnFub+EQx+3D/aDCg6iC7sjexOUa5GzxUNIZFFl0Pq7aDxbmhIludoyYnguEO3REyWf9FcOOmvVcQkdtwKHTw==} + dependencies: + '@iconify/types': 2.0.0 + dev: true + + /@iconify/tailwind@0.1.3: + resolution: {integrity: sha512-uVV49QtR9cZ9VLxrMSeW1E6iXWeBlpQ0z4aWx7B5WvGEE5OvCjloNYYqwZbZ/W+EsTcApzSm6szqcCVeb9pxDw==} + dependencies: + '@iconify/types': 2.0.0 + dev: true + + /@iconify/types@2.0.0: + resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} + dev: true + /@jridgewell/gen-mapping@0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} diff --git a/src/app.html b/src/app.html index 77ec85d..6e8ce1f 100644 --- a/src/app.html +++ b/src/app.html @@ -1,12 +1,15 @@ - + - - - - - %sveltekit.head% - - -
%sveltekit.body%
- + + + + + + %sveltekit.head% + + + +
%sveltekit.body%
+ + diff --git a/src/routes/+error.svelte b/src/routes/+error.svelte index d22e6bd..446535e 100644 --- a/src/routes/+error.svelte +++ b/src/routes/+error.svelte @@ -13,17 +13,16 @@ return name; } + + $: message = $page.error?.message; + $: errors = $page.error?.errors;
-

- {$page.error?.message} -

- - {#if $page.error?.errors != null} - {@const errors = $page.error.errors} +

{message}

+ {#if errors != null}

{errors.length} error{#if errors.length > 1}s{/if} occurred:

@@ -32,12 +31,8 @@ {#each errors as error}
  • - - {getLcNameOrDefault(error.impact)}: - - - {getLcNameOrDefault(error.message)} - + {getLcNameOrDefault(error.impact)}: + {getLcNameOrDefault(error.message)}

    Impact ID: {error.impact.id}

    diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index db0b4e1..ac8325c 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -20,21 +20,26 @@