diff --git a/package.json b/package.json index 7a8212d3..e5dbc21e 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "svelte-i18n": "3.3.9", "svelte-preprocess": "4.7.0", "svelte-select": "3.17.0", - "tailwindcss": "3.2.4", + "tailwindcss": "3.2.7", "tinro": "0.6.1", "toastify-js": "1.10.0", "validator": "13.5.2", diff --git a/src/components/dashboard/MainDashContent.svelte b/src/components/dashboard/MainDashContent.svelte index b3d6f294..9381c01e 100644 --- a/src/components/dashboard/MainDashContent.svelte +++ b/src/components/dashboard/MainDashContent.svelte @@ -1,22 +1,157 @@
{ navOpen = false; - }}> + }} +>

- {$_('dashboard-title')} + {$_("dashboard-title")} - - {$_('dashboard-greeting')}, - {store.state.jwtinfo.userdetails.firstname} {store.state.jwtinfo.userdetails.lastname} + {$_("dashboard-greeting")}, + {store.state.jwtinfo.userdetails.firstname} + {store.state.jwtinfo.userdetails.lastname}

- +

{$_("general-stats")}

+ {#await stats_promise} + + {:then stats} +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ {:catch error} +
+ + {$_("general_promise_error")} + {error} + +
+ {/await}
diff --git a/src/components/dashboard/StatCard.svelte b/src/components/dashboard/StatCard.svelte new file mode 100644 index 00000000..2079bfe1 --- /dev/null +++ b/src/components/dashboard/StatCard.svelte @@ -0,0 +1,22 @@ + + + +
+
+
+
+ {title} +
+
{value}
+
+ +
+
+
diff --git a/src/components/dashboard/StatCards.svelte b/src/components/dashboard/StatCards.svelte deleted file mode 100644 index 18d56adf..00000000 --- a/src/components/dashboard/StatCards.svelte +++ /dev/null @@ -1,165 +0,0 @@ - - - -

{$_('general-stats')}

-{#await stats_promise} - -{:then stats} -
- -
-
-
-
- {$_('runners')} -
-
{stats.total_runners}
-
- - -
-
-
-
-
-
-
-
- {$_('total-scans')} -
-
{stats.total_scans}
-
-
-
-
-
-
-
-
-
- {$_('total-donations')} -
-
{(stats.total_donation/100).toFixed(2)} €
-
- -
-
-
-
-
-
-
-
- {$_('total-distance')} -
-
- {stats.total_distance / 1000} - km -
-
- - -
-
-
- -
-
-
-
- {$_('count_teams')} -
-
{stats.total_teams}
-
- - - - -
-
-
- -
-
-
-
- {$_('count_organizations')} -
-
{stats.total_orgs}
-
- - -
-
-
-
-{:catch error} -
- - {$_('general_promise_error')} - {error} - -
-{/await}