fix: uploader layout

This commit is contained in:
not-nullptr 2024-11-11 15:50:19 +00:00
parent 112200b644
commit 9952d1563a
2 changed files with 15 additions and 5 deletions

View File

@ -5,15 +5,23 @@
files: FileList | undefined;
}
let fileInput = $state<HTMLInputElement>();
let { files = $bindable() }: Props = $props();
const upload = () => {
if (!fileInput) return;
fileInput.click();
};
</script>
<div
class="flex items-center justify-center flex-col border-2 border-solid border-foreground rounded-xl w-full max-w-screen-lg h-80"
<button
onclick={upload}
class="flex items-center justify-center cursor-pointer flex-col border-2 border-solid border-foreground rounded-xl px-4 py-2 w-full h-full"
>
<Upload />
<h2>Drop or click to upload files</h2>
<p class="text-foreground-muted">the</p>
</div>
</button>
<input type="file" class="hidden" bind:files />
<input type="file" class="hidden" bind:files bind:this={fileInput} />

View File

@ -5,7 +5,9 @@
</script>
<div class="flex items-center justify-center h-full">
<Uploader bind:files />
<div class="w-full max-w-screen-lg h-80">
<Uploader bind:files />
</div>
</div>
<style>