From bc47475e77f30760bfd330360a5065018a62a1f8 Mon Sep 17 00:00:00 2001 From: Arman Date: Tue, 12 Jul 2022 17:12:03 +0200 Subject: [PATCH] feat: add avatar to uploaded files --- src/lib/components/uploadBox.svelte | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/lib/components/uploadBox.svelte b/src/lib/components/uploadBox.svelte index ab584eed6..32876f516 100644 --- a/src/lib/components/uploadBox.svelte +++ b/src/lib/components/uploadBox.svelte @@ -2,12 +2,15 @@ import { uploader } from '$lib/stores/uploader'; import { Pill } from '$lib/elements'; import { sdkForProject } from '$lib/stores/sdk'; - + import { Avatar } from '$lib/components'; async function removeFile($id: string, bucketId: string) { const file = await sdkForProject.storage.getFile(bucketId, $id); console.log(file); uploader.removeFile(file); } + + const getPreview = (fileId: string, bucketId: string) => + sdkForProject.storage.getFilePreview(bucketId, fileId, 32, 32).toString() + '&mode=admin'; {#if $uploader?.isOpen} @@ -34,21 +37,17 @@