Added Goback Button for ContentPage
This commit is contained in:
@@ -1,15 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex h-screen">
|
<div class="flex h-[calc(100vh-120px)]">
|
||||||
|
<!-- Section Carousel (gauche) -->
|
||||||
|
<div class="flex-1 flex items-center justify-center bg-neutral-500 max-h-screen relative">
|
||||||
|
<!-- Bouton "X" positionné dans le coin supérieur gauche -->
|
||||||
|
<div class="absolute top-8 left-0">
|
||||||
|
<v-btn @click="goBack" variant="plain"
|
||||||
|
class="rounded-full bg-gray-800 text-white w-12 h-12 flex items-center justify-center">
|
||||||
|
<v-icon class="text-black bg-white rounded-full" size="36">mdi-close</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Carousel section (left) -->
|
|
||||||
<div class="flex-1 flex items-center justify-center bg-neutral-500">
|
|
||||||
<v-carousel
|
<v-carousel
|
||||||
v-if="data?.urls && data.urls.length > 0"
|
v-if="data?.urls && data.urls.length > 0"
|
||||||
hide-delimiters
|
hide-delimiters
|
||||||
:show-arrows="data.urls.length > 1"
|
:show-arrows="data.urls.length > 1"
|
||||||
:show-indicators="data.urls.length > 1"
|
:show-indicators="data.urls.length > 1"
|
||||||
class="w-full h-full flex items-center justify-center"
|
class="w-full h-full flex items-center justify-center"
|
||||||
|
|
||||||
>
|
>
|
||||||
<v-carousel-item
|
<v-carousel-item
|
||||||
v-for="url in data.urls"
|
v-for="url in data.urls"
|
||||||
@@ -21,39 +27,32 @@
|
|||||||
</v-carousel>
|
</v-carousel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Content details section (right) -->
|
<!-- Section Détails (droite) -->
|
||||||
<div class="fixed-width border-l-2 p-6 bg-white overflow-y-auto h-full">
|
<div class="fixed-width border-l-2 p-6 bg-white overflow-y-auto max-h-screen">
|
||||||
|
<!-- Détails du contenu -->
|
||||||
<!-- Content details -->
|
|
||||||
<div class="border-b-2 p-6 font-sans space-y-2">
|
<div class="border-b-2 p-6 font-sans space-y-2">
|
||||||
<div v-if="data && data.uri">
|
<!-- Accéder à createdByName -->
|
||||||
Uri: {{ data?.uri }}
|
<div v-if="data && data.createdByName">
|
||||||
|
Créé par: {{ data.createdByName }}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="data && data.title" class="font-semibold">
|
<div v-if="data && data.title" class="font-semibold">
|
||||||
Title: {{ data?.title }}
|
Titre: {{ data.title }}
|
||||||
</div>
|
</div>
|
||||||
<div v-if="data && data.description">
|
<div v-if="data && data.description">
|
||||||
Description: {{ data?.description }}
|
Description: {{ data.description }}
|
||||||
</div>
|
|
||||||
<div v-if="data && data.createdAt">
|
|
||||||
Date: {{ data?.createdAt }}
|
|
||||||
</div>
|
|
||||||
<div v-if="data && data.createdBy">
|
|
||||||
Creator: {{ data?.createdBy }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Comments Section -->
|
<!-- Section Commentaires -->
|
||||||
<div class="border-b-2 p-6">
|
<div class="border-b-2 p-6">
|
||||||
<h2 class="font-sans font-semibold">Commentaires</h2>
|
<h2 class="font-sans font-semibold">Commentaires</h2>
|
||||||
<MessageList :content-id="contentId"></MessageList>
|
<MessageList :content-id="contentId"></MessageList>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Post a new message -->
|
<!-- Poster un nouveau message -->
|
||||||
<div class="border-b-2 p-6">
|
<div class="border-b-2 p-6">
|
||||||
<PostMessage :content-id="contentId"></PostMessage>
|
<PostMessage :content-id="contentId"></PostMessage>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -85,6 +84,10 @@ const fetchContentData = async (contentId) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function goBack() {
|
||||||
|
window.history.go(-1);
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchContentData(contentId.value);
|
fetchContentData(contentId.value);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user