Breadcrumbs resit pres funkce

This commit is contained in:
Michal Kváček
2024-03-13 06:35:26 +01:00
parent 5cff3580b0
commit 48f57cde0d
28 changed files with 152 additions and 172 deletions
@@ -23,6 +23,7 @@ import {aircraftKeywords, flightEventKeywords, flightKeywords, metaData} from "s
import ContentCard from "components/ContentCard.vue";
import {usePhotosStore} from "stores/Photos";
import {computed} from "vue";
import {publicFlightBreadcrumbs} from "src/composables/breadcrumbs";
const {isQueryRunning, flight} = storeToRefs(useFlightsStore());
@@ -37,24 +38,10 @@ usePhotosStore().fetchPublic({flightId: flight.value.id});
const {isQueryRunning: arePhotosLoading, photos: flightPhotos} = storeToRefs(usePhotosStore());
const flightNameFormatted = flightName(flight.value);
useAppStore().setPageTitle(flightNameFormatted);
const event = computed(() => flight.value.event);
const breadcrumbs = [
{to: {name: 'homepage'}, label: "Polétání.cz"},
{to: {name: "publicProfileDetail", params: {username: props.pilot.publicUsername}}, label: `@${props.pilot.publicUsername}`},
]
if (event.value && event.value.isPublic) {
breadcrumbs.push({to: {name: 'publicEventsList', username: props.pilot.publicUsername}, label: "Události"});
breadcrumbs.push({
to: {
name: 'publicEventDetail',
params: {eventSlug: event.value.urlSlug, username: props.pilot.publicUsername}
}, label: event.value.name
});
}
breadcrumbs.push({label: flightNameFormatted})
useAppStore().setBreadcrumbs(breadcrumbs);
useAppStore().setPageTitle(flightNameFormatted);
useAppStore().setBreadcrumbs(publicFlightBreadcrumbs(props.pilot, flight.value, event.value, false));
useMeta(() => metaData({
title: `${flightNameFormatted} - ${props.pilot.name}`,