Refaktoring verejneho profilu, pridani zobrazeni udalosti

This commit is contained in:
Michal Kváček
2023-10-14 22:43:16 +02:00
parent 5b47c56c6f
commit 4c8952117b
12 changed files with 228 additions and 49 deletions
@@ -0,0 +1,55 @@
<script setup>
import FlightsListSkeleton from "components/flights/FlightsListSkeleton.vue";
import {event, events, fetchEvents, loading} from "src/composables/objects/event";
import EventsList from "components/event/EventsList.vue";
import {onMounted, watch} from "vue";
import PublicFlightEventSwitcher from "components/navigation/PublicFlightEventSwitcher.vue";
import {useAppStore} from "stores/App";
const props = defineProps({
loggedUser: {
type: Object,
required: false
},
username: {
type: String,
required: true
}
});
watch(() => props.username, () => {
}, {immediate: true});
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"}
]);
fetchEvents(props.username);
}
);
</script>
<template>
<PublicFlightEventSwitcher :username="username"/>
<FlightsListSkeleton v-if="loading"/>
<q-banner class="bg-primary text-white" v-else-if="!loading && events.length === 0">
Tento pilot zatím nepublikoval žádnou udalost.
</q-banner>
<template v-else>
<EventsList
:items="events"
:route-detail="{name: 'publicEventDetail', params: {username: username}}"
class="q-mb-md"
/>
</template>
</template>