diff --git a/client/src/AccountCard.svelte b/client/src/AccountCard.svelte index 37357b2..2898436 100644 --- a/client/src/AccountCard.svelte +++ b/client/src/AccountCard.svelte @@ -6,6 +6,9 @@ import DetailField from './DetailField.svelte'; import GreenButton from './GreenButton.svelte'; import {createEventDispatcher} from 'svelte'; + import { fade, fly, slide } from 'svelte/transition'; + import { flip } from 'svelte/animate'; + const dispatch = createEventDispatcher(); @@ -17,26 +20,42 @@ export let isExpanded=false; export let transactions=[]; + let copied = false; + function copyIban(){ - //todo: Code here - dispatch("copiedIban",null); + if(!copied){ + navigator.clipboard.writeText(iban) + .then(() => copied = true) + .then(() => setTimeout(() => { + copied = false; + }, 1000)); + } } function expand(){ //todo: Code here dispatch("expanded",isExpanded); } + + function send(){ + //todo: CHeck here + dispatch("createPopup",{ + type: 'send_money', + iban, + }); + } - + +

{type}

IBAN: {iban} - +
-
+
@@ -51,37 +70,40 @@
{#if isExpanded } - {#each transactions as transaction} - -
-

{transaction.title}:

- {transaction.amount} - {currency} -
-
-

at {transaction.time}

- - {#if transaction.status == "PROCESSED"} - - - - {:else if transaction.status == "PENDING"} - - - - {:else if transaction.status == "CANCELLED"} - - - - {:else} - - - - {/if} - {transaction.status} - -
-
+ {#each transactions as transaction,i (i)} +
+ + +
+

{transaction.title}:

+ {transaction.amount} + {currency} +
+
+

at {transaction.time}

+ + {#if transaction.status == "PROCESSED"} + + + + {:else if transaction.status == "PENDING"} + + + + {:else if transaction.status == "CANCELLED"} + + + + {:else} + + + + {/if} + {transaction.status} + +
+
+
{/each} {:else if transactions.length > 0} @@ -132,7 +154,7 @@
- + send money @@ -153,6 +175,7 @@ +