Update post btn
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
<div>
|
<div>
|
||||||
{{ props.content.description }}
|
{{ props.content.description }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import {useClient} from '@/plugins/api.js';
|
import {useClient} from '@/plugins/api.js';
|
||||||
import {ref} from 'vue';
|
import {ref} from 'vue';
|
||||||
import {useUserStore} from '@/stores/userStore.js';
|
import {useUserStore} from '@/stores/userStore.js';
|
||||||
import {v7} from 'uuid'
|
import {v7} from 'uuid';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
creator: {type: Object, required: true},
|
creator: {type: Object, required: true},
|
||||||
@@ -15,10 +15,9 @@ const isDialogActive = ref(false);
|
|||||||
const client = useClient();
|
const client = useClient();
|
||||||
const title = ref('');
|
const title = ref('');
|
||||||
const message = ref('');
|
const message = ref('');
|
||||||
const files = ref([])
|
const files = ref([]);
|
||||||
|
|
||||||
async function publishPost() {
|
async function publishPost() {
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('id', v7());
|
formData.append('id', v7());
|
||||||
formData.append('creatorId', userStore.user.id);
|
formData.append('creatorId', userStore.user.id);
|
||||||
@@ -36,29 +35,27 @@ async function publishPost() {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'multipart/form-data',
|
'Content-Type': 'multipart/form-data',
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
);
|
||||||
closeDialog()
|
closeDialog();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const cancelPost = () => {
|
const cancelPost = () => {
|
||||||
closeDialog()
|
closeDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
const closeDialog = () => {
|
const closeDialog = () => {
|
||||||
isDialogActive.value = false
|
isDialogActive.value = false;
|
||||||
title.value = ''
|
title.value = '';
|
||||||
message.value = ''
|
message.value = '';
|
||||||
files.value = []
|
files.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
v-if="creator && userStore.user && creator.id === userStore.user.id"
|
v-if="creator && userStore.user && creator.id === userStore.user.id"
|
||||||
class="flex items-center text-white transform transition-transform duration-200 hover:text-gray-300 hover:scale-125 px-4"
|
class="flex items-center text-white transform transition-transform duration-200 hover:text-gray-300 hover:scale-125 px-4"
|
||||||
@@ -66,20 +63,33 @@ const closeDialog = () => {
|
|||||||
<v-icon style="font-size: 35px; height: 35px; width: 55px;">mdi-text-box-plus-outline</v-icon>
|
<v-icon style="font-size: 35px; height: 35px; width: 55px;">mdi-text-box-plus-outline</v-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<v-dialog v-model="isDialogActive"
|
<v-dialog v-model="isDialogActive" max-width="500">
|
||||||
max-width="500">
|
|
||||||
|
|
||||||
<v-form>
|
<v-form>
|
||||||
|
<v-card class="text-center rounded-xl"
|
||||||
<v-card class="text-center rounded-xl">
|
:style="{
|
||||||
|
border: `3px solid ${creator.colors.menu}`
|
||||||
<v-card-title class="text-white p-4 rounded-t"
|
}">
|
||||||
:style="{backgroundColor: creator.colors.menu || '#A30E79'}">
|
|
||||||
|
<div class="py-4 text-2xl font-bold border-b mb-2">
|
||||||
Quicky
|
Quicky
|
||||||
</v-card-title>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-row align-center px-3">
|
||||||
|
<img
|
||||||
|
:src="userStore.portraitUrl"
|
||||||
|
alt="Profile Image"
|
||||||
|
class="rounded-full"
|
||||||
|
width="40"
|
||||||
|
height="40"
|
||||||
|
:style="{
|
||||||
|
border: `2px solid ${creator.colors.accent}`
|
||||||
|
}">
|
||||||
|
<div class="capitalize px-2 text-2xl">{{ userStore.creator.name }}</div>
|
||||||
|
<v-btn icon @click="cancelPost" class="ml-auto" variant="text">
|
||||||
|
<v-icon>mdi-close</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
|
|
||||||
<v-text-field v-model="title"
|
<v-text-field v-model="title"
|
||||||
class="p-2"
|
class="p-2"
|
||||||
label="Titre"
|
label="Titre"
|
||||||
@@ -100,26 +110,26 @@ const closeDialog = () => {
|
|||||||
></v-textarea>
|
></v-textarea>
|
||||||
|
|
||||||
<v-file-input v-model="files"
|
<v-file-input v-model="files"
|
||||||
label="Ajoutez des fichiers"
|
label="Glissez vos images"
|
||||||
class="p-2"
|
class="p-2 custom-file-input"
|
||||||
outlined
|
variant="outlined"
|
||||||
multiple
|
multiple
|
||||||
dropzone
|
dropzone
|
||||||
placeholder="Glissez et déposez des fichiers ici ou cliquez pour sélectionner des fichiers"
|
prepend-icon=""
|
||||||
></v-file-input>
|
placeholder="Glissez et déposez des fichiers ici ou cliquez pour sélectionner des fichiers"
|
||||||
|
></v-file-input>
|
||||||
|
|
||||||
|
<v-btn variant="outlined" :style="{ borderColor: creator.colors.menu, color: creator.colors.menu }" @click="publishPost" class="w-full">
|
||||||
|
Publier
|
||||||
|
</v-btn>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
|
||||||
<v-card-actions class="justify-end">
|
|
||||||
<v-btn color="secondary" @click="cancelPost">Annuler</v-btn>
|
|
||||||
<v-btn color="primary" @click="publishPost">Publier</v-btn>
|
|
||||||
</v-card-actions>
|
|
||||||
|
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
</v-form>
|
</v-form>
|
||||||
|
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
class="rounded-full border-solid border-2 z-20 lg:max-w-[200px] max-w-[200px] h-auto"
|
class="rounded-full border-solid border-2 z-20 lg:max-w-[200px] max-w-[200px] h-auto"
|
||||||
:src="creator.images.logo"
|
:src="creator.images.logo"
|
||||||
alt="Profile Picture"
|
alt="Profile Picture"
|
||||||
:style="{ borderColor: creator.colors.accent || '#A30E79', height: '150px' /* Adjust the height here */ }"
|
:style="{ borderColor: creator.colors.accent || '#A30E79', height: '150px'}"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user