Vylepseni SSR, pridani meta informaci, zatim dost WIP
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
<script setup>
|
||||
import {useRoute} from "vue-router";
|
||||
import PublicProfileSkeleton from "components/profile/PublicProfileSkeleton.vue";
|
||||
import {storeToRefs} from "pinia";
|
||||
<script>
|
||||
import {useUserStore} from "stores/User";
|
||||
import PilotProfileCard from "components/profile/PilotProfileCard.vue";
|
||||
import {onMounted} from "vue";
|
||||
|
||||
const loggedUser = storeToRefs(useUserStore()).user;
|
||||
const username = useRoute().params.username;
|
||||
export default {
|
||||
preFetch({currentRoute}) {
|
||||
return useUserStore().fetchPublicUserDetail(currentRoute.params.username);
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<script setup>
|
||||
import {storeToRefs} from "pinia";
|
||||
import PilotProfileCard from "components/profile/PilotProfileCard.vue";
|
||||
import PublicProfileSkeleton from "components/profile/PublicProfileSkeleton.vue";
|
||||
|
||||
const {publicUser: pilot, isQueryRunning: pilotLoading} = storeToRefs(useUserStore());
|
||||
|
||||
onMounted(() => {
|
||||
useUserStore().fetchPublicUserDetail(username);
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-8">
|
||||
<router-view :logged-user="loggedUser" :username="username"/>
|
||||
<router-view :pilot="pilot"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<PublicProfileSkeleton v-if="pilotLoading || !pilot"/>
|
||||
<PublicProfileSkeleton v-if="pilotLoading && !pilot"/>
|
||||
<PilotProfileCard v-else :pilot="pilot"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user