feat(events): calendar date-picker popup, remove calendar page, My Tickets filtering #110
3 changed files with 2 additions and 83 deletions
refactor(events): remove the standalone calendar page
The calendar is now a date-picker popup on the feed (and, next, a visual on My Tickets), so the dedicated /events/calendar page and route are no longer needed. Delete EventsCalendarPage.vue, drop its route, and update the stale openCreate comment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
commit
e54938ef06
|
|
@ -33,15 +33,6 @@ export const eventsModule = createModulePlugin({
|
|||
requiresAuth: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/events/calendar',
|
||||
name: 'events-calendar',
|
||||
component: () => import('./views/EventsCalendarPage.vue'),
|
||||
meta: {
|
||||
title: 'Calendar',
|
||||
requiresAuth: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/events/map',
|
||||
name: 'events-map',
|
||||
|
|
|
|||
|
|
@ -1,70 +0,0 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { ArrowLeft, Ticket } from 'lucide-vue-next'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { useEvents } from '../composables/useEvents'
|
||||
import { useOwnedTickets } from '../composables/useOwnedTickets'
|
||||
import { useAuth } from '@/composables/useAuthService'
|
||||
import EventCalendarView from '../components/EventCalendarView.vue'
|
||||
import type { Event } from '../types/event'
|
||||
|
||||
const router = useRouter()
|
||||
const { t } = useI18n()
|
||||
const { allEvents, subscribe } = useEvents()
|
||||
const { ownedEventIds } = useOwnedTickets()
|
||||
const { isAuthenticated } = useAuth()
|
||||
|
||||
// Per-page toggle, intentionally not wired to the feed's
|
||||
// onlyOwnedTickets filter — narrowing the calendar shouldn't also
|
||||
// narrow the feed the user navigates back to.
|
||||
const onlyMine = ref(false)
|
||||
|
||||
const visibleEvents = computed<Event[]>(() => {
|
||||
if (!onlyMine.value) return allEvents.value
|
||||
const owned = ownedEventIds.value
|
||||
return allEvents.value.filter(a => owned.has(a.id))
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
subscribe()
|
||||
})
|
||||
|
||||
function handleSelectEvent(event: Event) {
|
||||
router.push({ name: 'event-detail', params: { id: event.id } })
|
||||
}
|
||||
|
||||
function goBack() {
|
||||
router.push({ name: 'events' })
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="container mx-auto px-4 py-6 max-w-lg">
|
||||
<!-- Back to the events feed (mirrors EventDetailPage) + the
|
||||
My-tickets filter on one row. Both left-aligned so they clear
|
||||
the fixed top-right hamburger menu, and the filter no longer
|
||||
takes a row to itself. -->
|
||||
<div class="flex items-center gap-2 mb-4">
|
||||
<Button variant="ghost" size="sm" class="gap-1.5" @click="goBack">
|
||||
<ArrowLeft class="w-4 h-4" />
|
||||
{{ t('common.nav.back', 'Back') }}
|
||||
</Button>
|
||||
<Button
|
||||
v-if="isAuthenticated"
|
||||
:variant="onlyMine ? 'default' : 'outline'"
|
||||
size="sm"
|
||||
class="gap-1.5"
|
||||
@click="onlyMine = !onlyMine"
|
||||
>
|
||||
<Ticket class="w-3.5 h-3.5" />
|
||||
{{ t('events.filters.myTickets', 'My tickets') }}
|
||||
</Button>
|
||||
</div>
|
||||
<EventCalendarView
|
||||
:events="visibleEvents"
|
||||
@select-event="handleSelectEvent"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -84,10 +84,8 @@ function handleSelectEvent(event: Event) {
|
|||
router.push({ name: 'event-detail', params: { id: event.id } })
|
||||
}
|
||||
|
||||
// Create-activity CTA in the Hosting view. Calendar-tab → page lives
|
||||
// on /events/calendar; the icon button at the end of the date
|
||||
// strip is the only entry point now that the bottom-nav Calendar
|
||||
// tab is gone.
|
||||
// Create-activity CTA in the Hosting view. Replaces the old bottom-nav
|
||||
// Create entry; shown only while the Hosting filter is active.
|
||||
function openCreate() {
|
||||
eventsStore.editingEvent = null
|
||||
eventsStore.showCreateDialog = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue