Added images

This commit is contained in:
Dominic Villemure
2024-06-30 23:39:56 -04:00
parent 169e2cc160
commit 5f54b69e00
7 changed files with 160 additions and 82 deletions

View File

@@ -6,9 +6,9 @@
Personnaliser votre profil
</h1>
<ProfileBanner :user="currentUser"></ProfileBanner>
<ProfileBanner @updateProfilePicture="updateProfilePicture" @updateBannerPicture="updateBannerPicture" :user="currentUser"></ProfileBanner>
<AboutYou :user="currentUser"></AboutYou>
<SocialLinks :social-networks="currentUser.socialNetworks"></SocialLinks>
<SocialLinks :user="currentUser" @updateWebsiteIcon="updateWebsiteIcon"></SocialLinks>
<div class="sticky inset-x-0 bottom-0 flex justify-center px-4 pb-4">
<div class="flex space-x-2">
@@ -46,7 +46,7 @@ import {useClient} from "@/plugins/api.js";
const userStore = useUserStore();
const client = useClient();
const currentUser = ref(MyUserModel)
const currentUser = ref(MyUserModel);
const snackbar = ref(false);
onBeforeMount( () => {
@@ -57,9 +57,25 @@ onBeforeMount( () => {
}
})
const profilePicture = ref(null);
const bannerPicture = ref(null);
const websiteIcon = ref(null);
const updateProfilePicture = (file) => {
profilePicture.value = file;
};
const updateBannerPicture = (file) => {
bannerPicture.value = file;
};
const updateWebsiteIcon = (file) => {
websiteIcon.value = file;
};
async function saveForm(){
snackbar.value = true;
await userStore.updateCurrentUser(client, currentUser.value);
await userStore.updateCurrentUser(client, currentUser.value, profilePicture.value, bannerPicture.value, websiteIcon.value);
}
</script>