Vylepseni SSR, pridani meta informaci, zatim dost WIP

This commit is contained in:
Michal Kváček
2023-11-28 11:35:53 +01:00
parent 86605ad53e
commit 11cc6ad107
28 changed files with 371 additions and 403 deletions
@@ -1,43 +1,39 @@
<script setup>
import FlightsListSkeleton from "components/flights/FlightsListSkeleton.vue";
import EventsList from "components/event/EventsList.vue";
import {onMounted, watch} from "vue";
import PublicFlightEventSwitcher from "components/navigation/PublicFlightEventSwitcher.vue";
import {useAppStore} from "stores/App";
import {useEventsStore} from "stores/Events";
import {storeToRefs} from "pinia";
import {useMeta} from "quasar";
import {commonKeywords, metaData} from "src/composables/meta";
const props = defineProps({
loggedUser: {
pilot: {
type: Object,
required: false
},
username: {
type: String,
required: true
}
});
watch(() => props.username, () => {
}, {immediate: true});
useMeta(() => metaData({
title: `${props.pilot.publicUsername} - Události`,
keywords: [...commonKeywords, "pilot"],
description: "Detail pilota na poletani.cz",
}));
onMounted(() => {
// const eventNameFormatted = eventName(newVal);
useAppStore().setPageTitle(`${props.username}`);
useAppStore().setBreadcrumbs([
{to: {name: 'homepage'}, label: "Polétání.cz"},
{to: {name: "publicProfileDetail", params: {username: props.username}}, label: `@${props.username}`},
{label: "Události"}
]);
useEventsStore().fetch(props.username);
}
);
useAppStore().setPageTitle(`${props.pilot.publicUsername}`);
useAppStore().setBreadcrumbs([
{to: {name: 'homepage'}, label: "Polétání.cz"},
{to: {name: "publicProfileDetail", params: {username: props.pilot.publicUsername}}, label: `@${props.pilot.publicUsername}`},
{label: "Události"}
]);
useEventsStore().fetch(props.pilot.publicUsername);
const {isQueryRunning, events} = storeToRefs(useEventsStore());
</script>
<template>
<PublicFlightEventSwitcher :username="username"/>
<PublicFlightEventSwitcher :username="pilot.publicUsername"/>
<FlightsListSkeleton v-if="isQueryRunning"/>
@@ -48,7 +44,7 @@ const {isQueryRunning, events} = storeToRefs(useEventsStore());
<template v-else>
<EventsList
:items="events"
:route-detail="{name: 'publicEventDetail', params: {username: username}}"
:route-detail="{name: 'publicEventDetail', params: {username: pilot.publicUsername}}"
class="q-mb-md"
/>
</template>