feat: remove compact

This commit is contained in:
EETagent 2022-12-23 21:40:54 +01:00
parent 4be811d3e7
commit 8147eb1f4d
2 changed files with 22 additions and 29 deletions

View file

@ -4,7 +4,6 @@
import DashboardUploadCard from './DashboardUploadCard.svelte'; import DashboardUploadCard from './DashboardUploadCard.svelte';
import type { ApiError } from '$lib/@api'; import type { ApiError } from '$lib/@api';
export let compact: boolean = false;
let error: string | null = null; let error: string | null = null;
const onFileDrop = async (detail: any) => { const onFileDrop = async (detail: any) => {
@ -27,7 +26,6 @@
<DashboardUploadCard <DashboardUploadCard
{error} {error}
{compact}
on:filedrop={(e) => onFileDrop(e.detail)} on:filedrop={(e) => onFileDrop(e.detail)}
on:delete={onDelete} on:delete={onDelete}
title="Motivační dopis" title="Motivační dopis"

View file

@ -20,7 +20,6 @@
export let filesize: number; export let filesize: number;
export let fileType: number; export let fileType: number;
export let placeholder: string = ''; export let placeholder: string = '';
export let compact: boolean = false;
let fileDropped: boolean = false; let fileDropped: boolean = false;
let progress: number = 1; let progress: number = 1;
@ -102,11 +101,9 @@
<div class="card uploadCard relative"> <div class="card uploadCard relative">
<div class="header"> <div class="header">
<h3 class="mb-4 sm:mb-0">{title}</h3> <h3 class="mb-4 sm:mb-0">{title}</h3>
{#if !compact} <div class="mb-4 mt-1 sm:mb-0 sm:mt-0">
<div class="mb-4 mt-1 sm:mb-0 sm:mt-0"> <FileType {filetype} filesize={filesize + ' MB'} />
<FileType {filetype} filesize={filesize + ' MB'} /> </div>
</div>
{/if}
<div class="absolute right-0 top-4 flex items-center px-7"> <div class="absolute right-0 top-4 flex items-center px-7">
{#if status === 'uploaded'} {#if status === 'uploaded'}
<button <button
@ -117,28 +114,26 @@
<StatusNotificationDot {status} /> <StatusNotificationDot {status} />
</div> </div>
</div> </div>
{#if fileDropped && error === null} {#if fileDropped && error === null}
<div class="body uploaded flex content-around items-center justify-between"> <div class="body uploaded flex content-around items-center justify-between">
{#if !compact} <div class="w-24">
<div class="w-24"> <img
<img class="w-full object-scale-down"
class="w-full object-scale-down" src={filetype == 'PDF' ? documentIcon : archiveIcon}
src={filetype == 'PDF' ? documentIcon : archiveIcon} alt="Icon"
alt="Icon" />
/> </div>
</div> <svg class="h-25 hidden xl:block" viewBox="0 0 2 40" xmlns="http://www.w3.org/2000/svg"
<svg class="h-25 hidden xl:block" viewBox="0 0 2 40" xmlns="http://www.w3.org/2000/svg" ><line
><line x1="0"
x1="0" y="0"
y="0" x2="0"
x2="0" y2="40"
y2="40" stroke="#406280ff"
stroke="#406280ff" stroke-width="2"
stroke-width="2" stroke-dasharray="3"
stroke-dasharray="3" /></svg
/></svg >
>
{/if}
<div class="hidden items-center xl:block"> <div class="hidden items-center xl:block">
{#if bytesTotal === 0 || Math.round(progress * 100) === 100} {#if bytesTotal === 0 || Math.round(progress * 100) === 100}
<h2 class="text-xl font-bold">{status === 'submitted' ? 'Odesláno' : 'Nahráno'}</h2> <h2 class="text-xl font-bold">{status === 'submitted' ? 'Odesláno' : 'Nahráno'}</h2>