Enable users to see all their saved events on the home screen, sorted by date with upcoming events first. Key capabilities: - EventCard with title, relative time display, and organizer/attendee role badge - Sortable EventList with past-event visual distinction (faded style) - Empty state when no events are stored - Swipe-to-delete gesture with confirmation dialog - Floating action button for quick event creation - Rename router param :token → :eventToken across all views - useRelativeTime composable (Intl.RelativeTimeFormat) - useEventStorage: add validation, removeEvent(), reactive versioning - Full E2E and unit test coverage for all new components Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
43 lines
966 B
Vue
43 lines
966 B
Vue
<template>
|
|
<main class="home">
|
|
<h1 class="home__title">fete</h1>
|
|
<template v-if="events.length > 0">
|
|
<EventList />
|
|
<CreateEventFab />
|
|
</template>
|
|
<template v-else>
|
|
<EmptyState />
|
|
</template>
|
|
</main>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { useEventStorage, isValidStoredEvent } from '../composables/useEventStorage'
|
|
import EventList from '../components/EventList.vue'
|
|
import EmptyState from '../components/EmptyState.vue'
|
|
import CreateEventFab from '../components/CreateEventFab.vue'
|
|
|
|
const { getStoredEvents } = useEventStorage()
|
|
|
|
const events = computed(() => getStoredEvents().filter(isValidStoredEvent))
|
|
</script>
|
|
|
|
<style scoped>
|
|
.home {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--spacing-lg);
|
|
padding-top: var(--spacing-lg);
|
|
}
|
|
|
|
.home__title {
|
|
font-size: 2rem;
|
|
font-weight: 800;
|
|
color: var(--color-text-on-gradient);
|
|
text-align: center;
|
|
}
|
|
|
|
</style>
|