feat: dynamic info button text

This commit is contained in:
Sebastian Pravda 2022-12-23 17:48:55 +01:00
parent 7fed62ff75
commit 75a525aa56
No known key found for this signature in database
GPG key ID: F3BC84F08EFA3F57
2 changed files with 5 additions and 2 deletions

View file

@ -59,7 +59,7 @@
<div class="mr-4">
<div on:click on:keydown class="flex flex-col">
<div class="flex flex-col h-20">
<InfoButton on:download={downloadPortfolio} on:showInfo={(_) => showDetails = !showDetails}></InfoButton>
<InfoButton bind:showDetails={showDetails} on:download={downloadPortfolio} on:showInfo={(_) => showDetails = !showDetails}></InfoButton>
</div>
</div>
</div>

View file

@ -4,6 +4,8 @@
import { createEventDispatcher } from 'svelte';
import { submissionProgress, UploadStatus } from '$lib/stores/portfolio';
export let showDetails: boolean;
const dispatch = createEventDispatcher();
const showInfo = () => {
@ -16,10 +18,11 @@
</script>
<div class="flex flex-col">
<!-- TODO: better icon for "hide details"? -->
<div class="flex flex-col">
<span on:click={(_) => showInfo()} on:keydown={(_) => showInfo()}
use:tippy={{
content: "Zobrazit osobní údaje",
content: (showDetails ? "Skrýt" : "Zobrazit") + " osobní údaje",
placement: 'top',
showOnCreate: false,
delay: 0