Update-Current-User WIP

This commit is contained in:
Dominic Villemure
2024-06-29 22:44:49 -04:00
parent 81fe5abd7b
commit b07ca6f364
9 changed files with 168 additions and 134 deletions

View File

@@ -2,13 +2,13 @@
<div class="px-2">
<div class="flex flex-col max-w-2xl mx-auto rounded-3xl shadow-2xl mt-2 mb-16">
<H1 class="text-center text-4xl bg-fuchsia-900 p-3 rounded-t-3xl border-b-4 border-b-gray-200 font-sans text-white">
<h1 class="text-center text-4xl bg-fuchsia-900 p-3 rounded-t-3xl border-b-4 border-b-gray-200 font-sans text-white">
Personnaliser votre profil
</H1>
</h1>
<ProfileBanner></ProfileBanner>
<Aboutyou></Aboutyou>
<SocialLinks></SocialLinks>
<ProfileBanner :user="currentUser"></ProfileBanner>
<Aboutyou :user="currentUser"></Aboutyou>
<SocialLinks :social-networks="currentUser.socialNetworks"></SocialLinks>
<div class="sticky inset-x-0 bottom-0 flex justify-center px-4 pb-4">
<div class="flex space-x-2">
@@ -28,6 +28,23 @@ import Aboutyou from "@/views/main/Aboutyou.vue";
import SocialLinks from "@/views/main/SocialLinks.vue";
import ProfileBanner from "@/views/main/ProfileBanner.vue";
import DonationPopup from "@/views/main/DonationPopup.vue";
import {onBeforeMount, ref} from "vue";
import {useClient} from "@/plugins/api.js";
import {useUserStore} from "@/stores/user.js";
import MyUserModel from "@/models/myUserModel.js";
const client = useClient();
const userStore = useUserStore();
const currentUser = ref(MyUserModel)
onBeforeMount(async () => {
try {
currentUser.value = await userStore.getCurrentUser(client);
} catch(error) {
console.log("User not logged")
}
})
</script>