From 5f8b7415a7df96422a7b0b641c6f9cb07c3c7f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Mur=C3=A7a?= Date: Fri, 18 Nov 2022 12:11:06 -0300 Subject: [PATCH] Create FileList component --- src/lib/CardList.svelte | 20 +++++++++++--------- src/lib/FileList.svelte | 33 +++++++++++++++++++++++++++++++++ src/lib/FileViewer.svelte | 31 ++++--------------------------- 3 files changed, 48 insertions(+), 36 deletions(-) create mode 100644 src/lib/FileList.svelte diff --git a/src/lib/CardList.svelte b/src/lib/CardList.svelte index cc47925..f8770d5 100644 --- a/src/lib/CardList.svelte +++ b/src/lib/CardList.svelte @@ -5,15 +5,17 @@ let canvasRefs = []; -
- {#each Array.from(files) as file, i} -
- -

{file.name}

-
- {canvasRefs[i] && startFileRead(file, canvasRefs[i])} - {/each} -
+{#if files.length !== 0} +
+ {#each Array.from(files) as file, i} +
+ +

{file.name}

+
+ {canvasRefs[i] && startFileRead(file, canvasRefs[i])} + {/each} +
+{/if} diff --git a/src/lib/FileViewer.svelte b/src/lib/FileViewer.svelte index 45e1574..b1b98d0 100644 --- a/src/lib/FileViewer.svelte +++ b/src/lib/FileViewer.svelte @@ -1,5 +1,6 @@