Tweaking post UI

This commit is contained in:
PascalMarchesseault
2024-08-07 02:18:38 -04:00
parent e69b606aec
commit fab99c288d
5 changed files with 126 additions and 38 deletions

View File

@@ -52,6 +52,46 @@ const closeDialog = () => {
Informations de votre page Informations de votre page
</h1> </h1>
<!-- Nom de la page créateur -->
<div class="my-10 border rounded-2xl w-full max-w-[800px]">
<div class="py-5 uppercase ml-4">Informations</div>
<div class="flex flex-col w-full">
<button
@click="openDialog('Socials')"
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"> Nom de la page </span>
<span class="flex-auto text-left pr-6">{{ userStore.creator.socials.xUrl }}</span>
<span class="flex-none">
<v-icon>mdi-chevron-right</v-icon>
</span>
</button>
<button
@click="openDialog('Socials')"
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"> Titre </span>
<span class="flex-auto text-left pr-6">{{ userStore.creator.socials.xUrl }}</span>
<span class="flex-none">
<v-icon>mdi-chevron-right</v-icon>
</span>
</button>
<button
@click="openDialog('Socials')"
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"> Description </span>
<span class="flex-auto text-left pr-6">{{ userStore.creator.socials.websiteUrl }}</span>
<span class="flex-none">
<v-icon>mdi-chevron-right</v-icon>
</span>
</button>
</div>
</div>
<div class="border rounded-2xl w-full max-w-[800px]"> <div class="border rounded-2xl w-full max-w-[800px]">
<div class="py-5 uppercase ml-4">Bannière et image de profil</div> <div class="py-5 uppercase ml-4">Bannière et image de profil</div>
<div class="flex flex-col w-full"> <div class="flex flex-col w-full">

View File

@@ -44,8 +44,7 @@ function getComponent(url) {
</script> </script>
<template> <template>
<div class="shadow-md rounded-lg bg-gray-50"> <div class="shadow-md rounded-lg bg-gray-50 px-10">
<v-card <v-card
outlined outlined
tile tile
@@ -83,14 +82,13 @@ function getComponent(url) {
</v-card> </v-card>
<div> <div>
<div> <div>
<h2 class="font-sans font-semibold">Commentaires</h2> <h2 class="font-sans font-semibold mt-4">Commentaires</h2>
<message-list :subject-id="props.content.id" :messages="messages"> <message-list :subject-id="props.content.id" :messages="messages">
</message-list> </message-list>
</div> </div>
<div class="border-t-2 border-gray-300 mt-4 pt-4"> <div class="py-2">
<post-message :subject-id="props.content.id" @message-posted="addMessage"> <post-message :subject-id="props.content.id" @message-posted="addMessage">
</post-message> </post-message>
</div> </div>

View File

@@ -1,33 +1,34 @@
<template> <template>
<div class="flex flex-column"> <div class="flex flex-column py-2 ">
<div class="flex flex-row p-1 items-center"> <div class="flex flex-row full ">
<div class="px-2 content-center"> <div class="w-full">
<img :src="message.createdByPortraitUrl ?? '/images/usersmedia/anonyme/profilepictures/profileAnonymeSquare.png'"
alt="Profile Image"
class="rounded-full"
width="32px"
height="32px">
</div>
<div class="p-2 flex-1">
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<div> <div>
<div>
<span class="font-semibold font-sans mr-2"> <div class=" content-center flex flex-row">
<img
:src="message.createdByPortraitUrl ?? '/images/usersmedia/anonyme/profilepictures/profileAnonymeSquare.png'"
alt="Profile Image"
class="rounded-full"
width="32px"
height="32px">
<span class="font-semibold font-sans mr-2 capitalize ml-2">
{{ message.createdByName }} {{ message.createdByName }}
</span> </span>
<v-tooltip :text="new Date(message.createdAt).toLocaleString()"> <v-tooltip :text="new Date(message.createdAt).toLocaleString()">
<template v-slot:activator="{ props }"> <template v-slot:activator="{ props }">
<span v-bind="props" class="text-sm-caption text-gray-700"> <span v-bind="props" class="text-sm-caption text-gray-700 mt-1">
{{ time_ago(message.createdAt) }} {{ time_ago(message.createdAt) }}
</span> </span>
</template> </template>
</v-tooltip> </v-tooltip>
</div>
</div>
</div> </div>
<v-menu> <v-menu class="ml-auto">
<template v-slot:activator="{ props }"> <template v-slot:activator="{ props }">
<v-btn variant="plain" icon v-bind="props"> <v-btn variant="plain" icon v-bind="props">
<v-icon>mdi-dots-vertical</v-icon> <v-icon>mdi-dots-vertical</v-icon>
@@ -47,8 +48,9 @@
</v-menu> </v-menu>
</div> </div>
<div class="font-sans"> <div class="font-sans message-content">
{{ message.value }} <p class=" pb-2"> {{ message.value }}</p>
</div> </div>
</div> </div>
</div> </div>
@@ -60,7 +62,6 @@
import {time_ago} from "@/internal_time_ago.js"; import {time_ago} from "@/internal_time_ago.js";
const props = defineProps({ const props = defineProps({
message: { message: {
type: Object, type: Object,
@@ -90,4 +91,9 @@ function reportMessage(message) {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.message-content {
word-wrap: break-word;
word-break: break-word;
}
</style> </style>

View File

@@ -3,18 +3,18 @@
<v-infinite-scroll :items="messages" <v-infinite-scroll :items="messages"
:onLoad="load" :onLoad="load"
mode="manual" mode="manual"
class="bg-gray-300 rounded-md justify-items-center"> class="justify-items-center">
<template v-for="(message, index) in messages" :key="index"> <template v-for="(message, index) in messages" :key="index">
<message :message="message" <message :message="message"
class="m-2 p-2 rounded-md bg-gray-100" class="border-b"
></message> ></message>
</template> </template>
<template v-slot:load-more="{ props }"> <template v-slot:load-more="{ props }">
<v-btn <v-btn
size="small" size="small"
variant="plain" variant="outlined"
v-bind="props" v-bind="props"
>Voir plus de commentaires >Voir plus de commentaires
</v-btn> </v-btn>

View File

@@ -1,16 +1,42 @@
<template> <template>
<div class="flex flex-column"> <div class="flex flex-column">
<div class="flex flex-row"> <div class="flex flex-row items-center ">
<div class="mx-2 content-center"> <img :src="userStore.portraitUrl" alt="Profile Image" class="rounded-full mr-2" width="32px" height="32px">
<img :src="userStore.portraitUrl" alt="Profile Image" class="rounded-full" width="32px" height="32px"> <div class="flex-grow">
<div class="flex flex-row bg-gray-100 rounded-2xl">
<v-textarea
v-model="value"
density="compact"
variant="underlined"
placeholder="Votre commentaire..."
hide-details
auto-grow
rows="1"
maxlength="1024"
class="pr-1 ml-6 flex-grow"
@keydown.enter.prevent="publish"
>
</v-textarea>
<div class="flex flex-col justify-center">
<v-btn
icon
variant="text"
@click="publish"
>
<v-icon>mdi-send</v-icon>
</v-btn>
</div>
</div>
</div> </div>
<v-text-field v-model="value" density="compact" variant="solo-inverted" placeholder="Votre commentaire..." hide-details clearable></v-text-field>
</div> </div>
<div class="flex flex-row gap-2 mt-2 justify-end"> <div class="flex justify-end items-center mt-1">
<v-btn variant="plain">Annuler</v-btn> <div v-if="value.length < 1024" class="text-gray-500 text-sm">{{ value.length }}/1024</div>
<v-btn variant="tonal" @click="publish">Commenter</v-btn> <div v-if="value.length >= 1024" class="text-red-500 text-sm">{{ value.length }}/1024</div>
</div> </div>
</div> </div>
<v-dialog v-model="loginModal" max-width="400"> <v-dialog v-model="loginModal" max-width="400">
<v-card> <v-card>
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
@@ -90,3 +116,21 @@ const handleFailure = () => {
console.error('Login failed'); console.error('Login failed');
} }
</script> </script>
<style scoped>
.text-red-500 {
color: #f56565;
}
.text-gray-500 {
color: #a0aec0;
}
.text-sm {
font-size: 0.875rem;
}
.mt-1 {
margin-top: 0.25rem;
}
</style>