Adds SocialNetworks for Creators

This commit is contained in:
Jonathan Bourdon
2024-08-06 00:01:03 -04:00
parent b83db5b33b
commit fd1937b56f
28 changed files with 194 additions and 342 deletions

View File

@@ -1,24 +0,0 @@
<template>
<div class="pb-5 text-2xl">Lien Facebook</div>
<v-text-field
variant="outlined"
v-model="facebookLink"
label="Votre lien Facebook"
outlined
></v-text-field>
<div class="flex justify-end space-x-4">
<v-btn variant="plain" color="black">Annuler</v-btn>
<v-btn color="#A6147D">Enregistrer</v-btn>
</div>
</template>
<script setup>
import { ref } from 'vue';
const facebookLink = ref('');
</script>
<style scoped>
</style>

View File

@@ -1,24 +0,0 @@
<template>
<div class="pb-5 text-2xl">Lien Instagram</div>
<v-text-field
variant="outlined"
v-model="instagramLink"
label="Votre lien Instagram"
outlined
></v-text-field>
<div class="flex justify-end space-x-4">
<v-btn variant="plain" color="black">Annuler</v-btn>
<v-btn color="#A6147D">Enregistrer</v-btn>
</div>
</template>
<script setup>
import { ref } from 'vue';
const instagramLink = ref('');
</script>
<style scoped>
</style>

View File

@@ -1,24 +0,0 @@
<template>
<div class="pb-5 text-2xl">Lien LinkedIn</div>
<v-text-field
variant="outlined"
v-model="linkedInLink"
label="Votre lien LinkedIn"
outlined
></v-text-field>
<div class="flex justify-end space-x-4">
<v-btn variant="plain" color="black">Annuler</v-btn>
<v-btn color="#A6147D">Enregistrer</v-btn>
</div>
</template>
<script setup>
import { ref } from 'vue';
const linkedInLink = ref('');
</script>
<style scoped>
</style>

View File

@@ -1,24 +0,0 @@
<template>
<div class="pb-5 text-2xl">Lien Reddit</div>
<v-text-field
variant="outlined"
v-model="redditLink"
label="Votre lien Reddit"
outlined
></v-text-field>
<div class="flex justify-end space-x-4">
<v-btn variant="plain" color="black">Annuler</v-btn>
<v-btn color="#A6147D">Enregistrer</v-btn>
</div>
</template>
<script setup>
import { ref } from 'vue';
const redditLink = ref('');
</script>
<style scoped>
</style>

View File

@@ -1,24 +0,0 @@
<template>
<div class="pb-5 text-2xl">Lien TikTok</div>
<v-text-field
variant="outlined"
v-model="tiktokLink"
label="Votre lien TikTok"
outlined
></v-text-field>
<div class="flex justify-end space-x-4">
<v-btn variant="plain" color="black">Annuler</v-btn>
<v-btn color="#A6147D">Enregistrer</v-btn>
</div>
</template>
<script setup>
import { ref } from 'vue';
const tiktokLink = ref('');
</script>
<style scoped>
</style>

View File

@@ -1,24 +0,0 @@
<template>
<div class="pb-5 text-2xl">Page Web personnel</div>
<v-text-field
variant="outlined"
v-model="websiteLink"
label="Lien de votre page web personnel"
outlined
></v-text-field>
<div class="flex justify-end space-x-4">
<v-btn variant="plain" color="black">Annuler</v-btn>
<v-btn color="#A6147D">Enregistrer</v-btn>
</div>
</template>
<script setup>
import { ref } from 'vue';
const websiteLink = ref('');
</script>
<style scoped>
</style>

View File

@@ -1,24 +0,0 @@
<template>
<div class="pb-5 text-2xl">Lien X</div>
<v-text-field
variant="outlined"
v-model="xLink"
label="Votre lien x"
outlined
></v-text-field>
<div class="flex justify-end space-x-4">
<v-btn variant="plain" color="black">Annuler</v-btn>
<v-btn color="#A6147D">Enregistrer</v-btn>
</div>
</template>
<script setup>
import { ref } from 'vue';
const xLink = ref('');
</script>
<style scoped>
</style>

View File

@@ -1,24 +0,0 @@
<template>
<div class="pb-5 text-2xl">Lien Youtube</div>
<v-text-field
variant="outlined"
v-model="youtubeLink"
label="Votre lien Youtube"
outlined
></v-text-field>
<div class="flex justify-end space-x-4">
<v-btn variant="plain" color="black">Annuler</v-btn>
<v-btn color="#A6147D">Enregistrer</v-btn>
</div>
</template>
<script setup>
import { ref } from 'vue';
const youtubeLink = ref('');
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,123 @@
<script setup>
import {ref} from 'vue'
import {useClient} from "@/plugins/api.js";
const props = defineProps({
creator: {
required: true
}
})
const emits = defineEmits(['closeRequested'])
const facebookUrl = ref(props.creator.socialNetworks.facebookUrl)
const instagramUrl = ref(props.creator.socialNetworks.instagramUrl)
const linkedInUrl = ref(props.creator.socialNetworks.linkedInUrl)
const redditUrl = ref(props.creator.socialNetworks.redditUrl)
const tikTokUrl = ref(props.creator.socialNetworks.tikTokUrl)
const websiteUrl = ref(props.creator.socialNetworks.websiteUrl)
const xUrl = ref(props.creator.socialNetworks.xUrl)
const youtubeUrl = ref(props.creator.socialNetworks.youtubeUrl)
const client = useClient()
const save = async () => {
try {
await client.post(
`/api/creators/${props.creator.id}/socials`,
{
"facebookUrl": facebookUrl.value || null,
"instagramUrl": instagramUrl.value || null,
"linkedInUrl": linkedInUrl.value || null,
"redditUrl": redditUrl.value || null,
"tikTokUrl": tikTokUrl.value || null,
"websiteUrl": websiteUrl.value || null,
"xUrl": xUrl.value || null,
"youtubeUrl": youtubeUrl.value || null,
})
props.creator.socialNetworks.facebookUrl = facebookUrl
props.creator.socialNetworks.instagramUrl = instagramUrl
props.creator.socialNetworks.linkedInUrl = linkedInUrl
props.creator.socialNetworks.redditUrl = redditUrl
props.creator.socialNetworks.tikTokUrl = tikTokUrl
props.creator.socialNetworks.websiteUrl = websiteUrl
props.creator.socialNetworks.xUrl = xUrl
props.creator.socialNetworks.youtubeUrl = youtubeUrl
emits('closeRequested')
} catch (error) {
console.error(error)
}
}
const cancel = () => {
emits('closeRequested')
}
</script>
<template>
<div class="pb-5 text-2xl">Reseaux Sociaux</div>
<v-text-field
variant="outlined"
v-model="facebookUrl"
label="Lien Facebook"
outlined
></v-text-field>
<v-text-field
variant="outlined"
v-model="instagramUrl"
label="Lien Instagram"
outlined
></v-text-field>
<v-text-field
variant="outlined"
v-model="linkedInUrl"
label="Lien LinkedIn"
outlined
></v-text-field>
<v-text-field
variant="outlined"
v-model="redditUrl"
label="Lien Reddit"
outlined
></v-text-field>
<v-text-field
variant="outlined"
v-model="tikTokUrl"
label="Lien TikTok"
outlined
></v-text-field>
<v-text-field
variant="outlined"
v-model="websiteUrl"
label="Lien site web"
outlined
></v-text-field>
<v-text-field
variant="outlined"
v-model="xUrl"
label="Lien X"
outlined
></v-text-field>
<v-text-field
variant="outlined"
v-model="youtubeUrl"
label="Lien Youtube"
outlined
></v-text-field>
<div class="flex justify-end space-x-4">
<v-btn color="black" variant="text" @click="cancel">Annuler</v-btn>
<v-btn color="#A6147D" @click="save">Enregistrer</v-btn>
</div>
</template>

View File

@@ -1,13 +1,6 @@
<script setup>
import {ref} from 'vue';
import ModalFacebook from '@/views/Profile/Dialogs/PageInformations/ModalFacebook.vue';
import ModalInstagram from '@/views/Profile/Dialogs/PageInformations/ModalInstagram.vue';
import ModalLinkedIn from '@/views/Profile/Dialogs/PageInformations/ModalLinkedIn.vue';
import ModalReddit from '@/views/Profile/Dialogs/PageInformations/ModalReddit.vue';
import ModalTikTok from '@/views/Profile/Dialogs/PageInformations/ModalTikTok.vue';
import ModalWebsite from '@/views/Profile/Dialogs/PageInformations/ModalWebsite.vue';
import ModalX from '@/views/Profile/Dialogs/PageInformations/ModalX.vue';
import ModalYoutube from '@/views/Profile/Dialogs/PageInformations/ModalYoutube.vue';
import SocialNetworks from '@/views/Profile/Dialogs/PageInformations/SocialNetworks.vue';
import BannerPicker from '@/views/Profile/Dialogs/PageInformations/BannerPicker.vue';
import ColorTopBanner from '@/views/Profile/Dialogs/PageInformations/ColorTopBanner.vue';
import ColorBottomBanner from "@/views/Profile/Dialogs/PageInformations/ColorBottomBanner.vue";
@@ -22,14 +15,7 @@ const dialog = ref(false);
const currentComponent = ref('');
const componentsMap = {
ModalFacebook,
ModalInstagram,
ModalLinkedIn,
ModalReddit,
ModalTikTok,
ModalWebsite,
ModalX,
ModalYoutube,
SocialNetworks,
BannerPicker,
ColorTopBanner,
ColorBottomBanner,
@@ -39,6 +25,7 @@ const componentsMap = {
};
const openDialog = (component) => {
console.dir(userStore.creator)
currentComponent.value = componentsMap[component]
dialog.value = true
}
@@ -51,7 +38,7 @@ const closeDialog = () => {
</script>
<template>
<v-dialog v-model="dialog" max-width="600px">
<v-card>
<v-card-text>
@@ -62,7 +49,7 @@ const closeDialog = () => {
</v-card-text>
</v-card>
</v-dialog>
<div class="flex flex-col items-center w-full">
<h1 class="uppercase pb-5 text-2xl">
<v-icon class="mr-2">mdi-file-edit-outline</v-icon>
@@ -127,91 +114,92 @@ const closeDialog = () => {
<!-- Réseaux sociaux -->
<div class="mt-10 border rounded-2xl w-full max-w-[800px]">
<div class="py-5 uppercase ml-4">Réseaux Sociaux</div>
<div class="flex flex-col w-full">
<button
@click="openDialog('ModalFacebook')"
@click="openDialog('SocialNetworks')"
class="HoverBtn active:bg-gray-300 py-2 px-4 border-gray-400 shadow flex items-center transition duration-200 ease-in-out w-full">
<span class="pa-2 min-w-32 text-left"><v-icon>mdi-facebook</v-icon></span>
<span class="flex-auto text-left pr-6">Facebook</span>
<span class="flex-auto text-left pr-6">{{ userStore.creator.socialNetworks.facebookUrl }}</span>
<span class="flex-none">
<v-icon>mdi-chevron-right</v-icon>
</span>
</button>
<button
@click="openDialog('ModalInstagram')"
@click="openDialog('SocialNetworks')"
class="HoverBtn active:bg-gray-300 py-2 px-4 border-gray-400 shadow flex items-center transition duration-200 ease-in-out w-full">
<span class="flex-none pa-2 min-w-32 text-left"> <v-icon>mdi-instagram</v-icon></span>
<span class="flex-auto text-left pr-6">Instagram</span>
<span class="flex-auto text-left pr-6">{{ userStore.creator.socialNetworks.instagramUrl }}</span>
<span class="flex-none">
<v-icon>mdi-chevron-right</v-icon>
</span>
</button>
<button
@click="openDialog('ModalX')"
@click="openDialog('SocialNetworks')"
class="HoverBtn active:bg-gray-300 py-2 px-4 border-gray-400 shadow flex items-center transition duration-200 ease-in-out w-full">
<span class="flex-none pa-2 min-w-32 text-left"> <img src="/images/hutopymedia/icons/black/xblack.png"
class="w-5 h-5"></span>
<span class="flex-auto text-left pr-6">X</span>
<span class="flex-none pa-2 min-w-32 text-left"><v-icon>mdi-twitter</v-icon></span>
<span class="flex-auto text-left pr-6">{{ userStore.creator.socialNetworks.xUrl }}</span>
<span class="flex-none">
<v-icon>mdi-chevron-right</v-icon>
</span>
</button>
<button
@click="openDialog('ModalLinkedIn')"
@click="openDialog('SocialNetworks')"
class="HoverBtn active:bg-gray-300 py-2 px-4 border-gray-400 shadow flex items-center transition duration-200 ease-in-out w-full ">
<span class="pa-2 min-w-32 text-left"><v-icon>mdi-linkedin</v-icon></span>
<span class="flex-auto text-left pr-6">LinkedIn</span>
<span class="flex-auto text-left pr-6">{{ userStore.creator.socialNetworks.linkedInUrl }}</span>
<span class="flex-none">
<v-icon>mdi-chevron-right</v-icon>
</span>
</button>
<button
@click="openDialog('ModalTikTok')"
@click="openDialog('SocialNetworks')"
class="HoverBtn active:bg-gray-300 py-2 px-4 border-gray-400 shadow flex items-center transition duration-200 ease-in-out w-full ">
<span class="flex-none pa-2 min-w-32 text-left"> <img src="/images/externals/tiktok-black.png"
class="w-5 h-5"></span>
<span class="flex-auto text-left pr-6">TikTok</span>
<span class="flex-none pa-2 min-w-32 text-left">
<img src="/images/socials/tiktok-black.png" class="w-5 h-5">
</span>
<span class="flex-auto text-left pr-6">{{ userStore.creator.socialNetworks.tikTokUrl }}</span>
<span class="flex-none">
<v-icon>mdi-chevron-right</v-icon>
</span>
</button>
<button
@click="openDialog('ModalYoutube')"
@click="openDialog('SocialNetworks')"
class="HoverBtn active:bg-gray-300 py-2 px-4 border-gray-400 shadow flex items-center transition duration-200 ease-in-out w-full ">
<span class="pa-2 min-w-32 text-left"><v-icon>mdi-youtube</v-icon></span>
<span class="flex-auto text-left pr-6">Youtube</span>
<span class="flex-auto text-left pr-6">{{ userStore.creator.socialNetworks.youtubeUrl }}</span>
<span class="flex-none">
<v-icon>mdi-chevron-right</v-icon>
</span>
</button>
<button
@click="openDialog('ModalReddit')"
@click="openDialog('SocialNetworks')"
class="HoverBtn active:bg-gray-300 py-2 px-4 border-gray-400 shadow flex items-center transition duration-200 ease-in-out w-full ">
<span class="pa-2 min-w-32 text-left"><v-icon>mdi-reddit</v-icon></span>
<span class="flex-auto text-left pr-6">Reddit</span>
<span class="flex-auto text-left pr-6">{{ userStore.creator.socialNetworks.redditUrl }}</span>
<span class="flex-none">
<v-icon>mdi-chevron-right</v-icon>
</span>
</button>
<button
@click="openDialog('ModalWebsite')"
@click="openDialog('SocialNetworks')"
class="HoverBtn active:bg-gray-300 py-2 px-4 border-gray-400 shadow flex items-center transition duration-200 ease-in-out w-full rounded-b-2xl ">
<span class="pa-2 min-w-32 text-left"><v-icon>mdi-web</v-icon></span>
<span class="flex-auto text-left pr-6">Site web personnel</span>
<span class="flex-auto text-left pr-6">{{ userStore.creator.socialNetworks.websiteUrl }}</span>
<span class="flex-none">
<v-icon>mdi-chevron-right</v-icon>
</span>
</button>
</div>
</div>
</div>