Skip to content

Commit

Permalink
UX: Change Card container element to anchor
Browse files Browse the repository at this point in the history
This makes the whole card clickable instead of only the text inside.
  • Loading branch information
nas-tabchiche committed Nov 29, 2024
1 parent ba970a0 commit 44e2457
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions frontend/src/lib/components/DataViz/Card.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
export let count: string = '0';
export let label: string;
export let href: string | undefined = undefined;
export let href: string = '#';
// export let help: string;
export let icon: string;
export let section: string;
Expand All @@ -12,18 +12,19 @@
}
</script>

<div
<a
{href}
class="flex flex-col shadow-lg text-purple-800 p-2 h-28 bg-white hover:bg-violet-50 {cEmphasis}"
>
<div class="text-xs">
<span><i class={icon}></i></span>
<span>{section}</span>
</div>
<div class="mt-auto">
<a class="text-4xl font-bold text-left" {href}>{count}</a>
<p class="text-4xl font-bold text-left">{count}</p>
<div class="text-sm">{label}</div>
</div>
</div>
</a>

<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
Expand Down

0 comments on commit 44e2457

Please sign in to comment.