Commit 76169b0 1 parent bc74727 commit 76169b0 Copy full SHA for 76169b0
File tree 3 files changed +52
-2
lines changed
3 files changed +52
-2
lines changed Original file line number Diff line number Diff line change 36
36
@apply text-blue-900;
37
37
}
38
38
39
+ .event-card .loading {
40
+ @apply hover:shadow-none;
41
+ @apply cursor-default;
42
+ }
43
+
44
+ .event-card .loading > * {
45
+ @apply bg-primary-100 bg-opacity-75;
46
+ }
47
+
39
48
.event-card .assigned {
40
49
@apply border border-green-200;
41
50
}
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<RouterLink
3
+ v-if =" props.event"
3
4
:to =" { name: Routes.EventDetails, params: { year: props.event.start.getFullYear(), key: props.event.key } }"
4
5
class =" block hover:no-underline"
5
6
>
50
51
</div >
51
52
</div >
52
53
</RouterLink >
54
+ <div v-else class =" event-card loading animate-pulse" >
55
+ <div class =" flex" >
56
+ <div
57
+ class =" border-event-card -my-2 -ml-2 hidden w-32 flex-col items-center justify-center border-r sm:flex"
58
+ >
59
+ <span class =" mb-2 inline-block h-8 w-12 rounded-lg bg-primary-200" ></span >
60
+ <span class =" mb-2 inline-block h-4 w-16 rounded-lg bg-primary-200" ></span >
61
+ </div >
62
+ <div class =" flex flex-grow flex-col px-4 py-3 sm:px-8" >
63
+ <h3 class =" mb-2 flex items-center space-x-2" >
64
+ <span class =" mb-2 inline-block h-4 w-64 rounded-lg bg-primary-200" ></span >
65
+ </h3 >
66
+ <p class =" mb-4 flex text-sm" >
67
+ <span class =" mb-2 inline-block h-3 w-40 rounded-lg bg-primary-200" ></span >
68
+ <span class =" flex-grow" ></span >
69
+ <span class =" mb-2 inline-block h-3 w-12 rounded-lg bg-primary-200" ></span >
70
+ </p >
71
+ <div class =" flex flex-col flex-wrap justify-between" >
72
+ <div v-for =" i in 3" :key =" i" class =" flex items-center space-x-2" >
73
+ <span class =" my-1 inline-block h-4 w-4 rounded-full bg-primary-200" ></span >
74
+ <span class =" my-1 inline-block h-3 w-32 rounded-lg bg-primary-200" ></span >
75
+ </div >
76
+ </div >
77
+ </div >
78
+ </div >
79
+ </div >
53
80
</template >
54
81
<script lang="ts" setup>
55
82
import { DateTimeFormat } from ' @/common/date' ;
@@ -59,7 +86,7 @@ import { formatDateRange } from '@/ui/composables/DateRangeFormatter';
59
86
import { Routes } from ' @/ui/views/Routes' ;
60
87
61
88
interface Props {
62
- event: Event ;
89
+ event? : Event ;
63
90
}
64
91
65
92
const props = defineProps <Props >();
Original file line number Diff line number Diff line change 5
5
<div
6
6
class =" sticky top-12 z-10 -mx-4 flex h-14 justify-end bg-primary-50 pb-2 pt-4 xl:top-0 xl:h-16 xl:pt-8"
7
7
></div >
8
- <div v-if =" events.length === 0" class =" -mx-4 rounded-2xl bg-primary-100 p-4" >
8
+ <div v-if =" loading" class =" -mt-10" >
9
+ <div class =" pb-8" >
10
+ <div class =" pointer-events-none sticky top-16 z-10 flex pb-1 pt-2 xl:top-8" >
11
+ <h2 class =" inline-block text-primary-800 text-opacity-50" >Reisen werden geladen...</h2 >
12
+ </div >
13
+ <ul class =" -mx-4 max-w-xl" >
14
+ <li v-for =" i in 3" :key =" i" class =" mt-4" >
15
+ <EventCard />
16
+ </li >
17
+ </ul >
18
+ </div >
19
+ </div >
20
+ <div v-else-if =" events.length === 0" class =" -mx-4 rounded-2xl bg-primary-100 p-4" >
9
21
<h3 class =" mb-2" >Keine zukünftigen Reisen</h3 >
10
22
<p >Du hast dich bisher noch für keine Reise angemeldet</p >
11
23
</div >
@@ -64,6 +76,7 @@ const i18n = useI18n();
64
76
const user = authUseCase .getSignedInUser ();
65
77
66
78
const events = ref <Event []>([]);
79
+ const loading = ref <boolean >(true );
67
80
const searchterm = ref <string >(' ' );
68
81
69
82
const filteredEvents = computed <Event []>(() =>
@@ -108,6 +121,7 @@ function init(): void {
108
121
109
122
async function fetchEvents(): Promise <void > {
110
123
events .value = await eventUseCase .getFutureEventsByUser (user .key );
124
+ loading .value = false ;
111
125
}
112
126
113
127
init ();
You can’t perform that action at this time.
0 commit comments