Skip to content

Commit

Permalink
feat: Follow backend schema change
Browse files Browse the repository at this point in the history
  • Loading branch information
MrExplode committed Nov 29, 2023
1 parent cb09eb6 commit e76ef05
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/lib/components/dashboard/ImageContainer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
export let id: string
export let user: string
export let url: string
export let rawUrl: string
export let size: number
export let fileName: string
export let uploadDate: number
$: imageStyle = `background-image: url(https://api.unideb.tech/view/${id}/raw);`
$: imageStyle = `background-image: url(${rawUrl});`
</script>

<Card.Root class="w-60 h-60">
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/dashboard/ImagePreviewDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
export let id: string
export let user: string
export let url: string
export let rawUrl: string
export let size: number
export let fileName: string
export let uploadDate: number
Expand All @@ -27,7 +28,7 @@
<div class="cursor-pointer w-120 h-120 mb-10">
{#if url}
<!-- svelte-ignore a11y-img-redundant-alt -->
<img class="h-fit w-fit rounded-lg shadow-xl dark:shadow-gray-800" src={url} alt="Image" />
<img class="h-fit w-fit rounded-lg shadow-xl dark:shadow-gray-800" src={rawUrl} alt="Image" />
<div class="h-100 mt-2 p-4 border-y-2">
<span>Image name: {fileName}</span>
<span>Image size: {`${size / 1024} kb`}</span>
Expand Down
1 change: 1 addition & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface UploadInfo {
id: string
user: string
url: string
rawUrl: string
size: number
fileName: string
uploadDate: number
Expand Down
4 changes: 2 additions & 2 deletions src/routes/view/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<Centered>
<Card.Root>
<Card.Header>
<img src={view.upload.url} alt={view.upload.fileName} />
<img src={view.upload.rawUrl} alt={view.upload.fileName} />
</Card.Header>
<Card.Description>
<div class="flex flex-row m-5">
Expand All @@ -60,7 +60,7 @@
<div class="flex flex-col text-left">
<p>{view.upload.user}</p>
<p>{view.upload.fileName}</p>
<p>{Math.ceil(view.upload.size / 1024)} kb</p>
<p>{Math.ceil(view.upload.size / 1024)} Kb</p>
</div>
</div>
</Card.Description>
Expand Down

0 comments on commit e76ef05

Please sign in to comment.