From 5658fbb399377d07573737ab80b1324410e4f890 Mon Sep 17 00:00:00 2001 From: Sebastian Pravda Date: Fri, 23 Dec 2022 17:42:58 +0100 Subject: [PATCH] feat: enable download button only when submitted --- .../components/dashboard/InfoButton.svelte | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/dashboard/InfoButton.svelte b/frontend/src/lib/components/dashboard/InfoButton.svelte index 215fb8e..58497d4 100644 --- a/frontend/src/lib/components/dashboard/InfoButton.svelte +++ b/frontend/src/lib/components/dashboard/InfoButton.svelte @@ -2,6 +2,7 @@ import { tippy } from 'svelte-tippy'; import 'tippy.js/dist/tippy.css'; import { createEventDispatcher } from 'svelte'; + import { submissionProgress, UploadStatus } from '$lib/stores/portfolio'; const dispatch = createEventDispatcher(); @@ -26,14 +27,25 @@ + {#if $submissionProgress.status === UploadStatus.Submitted} + download()} on:keydown={(_) => download()} use:tippy={{ + content: "Stáhnout portfolio", + placement: 'top', + showOnCreate: false, + delay: 0 + }}> + + + {:else} download()} on:keydown={(_) => download()} use:tippy={{ - content: "Stáhnout portfolio", + content: "Nelze stáhnout, portfolio nebylo odevzdáno", placement: 'top', showOnCreate: false, delay: 0 }}> - - + + + {/if} @@ -41,4 +53,7 @@ .icon { @apply w-10 h-10 stroke-sspsBlueDark hover:cursor-pointer; } + .disabledIcon { + @apply w-10 h-10 stroke-gray-300 hover:cursor-not-allowed; + }