2019-11-15 18:36:47 +01:00
|
|
|
<template>
|
2020-02-18 08:57:00 +01:00
|
|
|
<div>
|
|
|
|
<form
|
|
|
|
class="new-comment"
|
2020-10-05 17:42:53 +02:00
|
|
|
v-if="isAbleToComment"
|
2020-02-18 08:57:00 +01:00
|
|
|
@submit.prevent="createCommentForEvent(newComment)"
|
|
|
|
@keyup.ctrl.enter="createCommentForEvent(newComment)"
|
|
|
|
>
|
2020-11-30 10:24:11 +01:00
|
|
|
<b-notification
|
|
|
|
v-if="isEventOrganiser && !areCommentsClosed"
|
|
|
|
:closable="false"
|
|
|
|
>{{ $t("Comments are closed for everybody else.") }}</b-notification
|
|
|
|
>
|
2020-02-18 08:57:00 +01:00
|
|
|
<article class="media">
|
2021-09-29 18:21:24 +02:00
|
|
|
<figure class="media-left" v-if="newComment.actor">
|
2020-02-18 08:57:00 +01:00
|
|
|
<identity-picker-wrapper :inline="false" v-model="newComment.actor" />
|
|
|
|
</figure>
|
|
|
|
<div class="media-content">
|
|
|
|
<div class="field">
|
2021-06-01 18:08:03 +02:00
|
|
|
<div class="field">
|
|
|
|
<p class="control">
|
|
|
|
<editor
|
|
|
|
ref="commenteditor"
|
|
|
|
mode="comment"
|
|
|
|
v-model="newComment.text"
|
2021-10-10 16:24:12 +02:00
|
|
|
:aria-label="$t('Comment body')"
|
2021-06-01 18:08:03 +02:00
|
|
|
/>
|
|
|
|
</p>
|
|
|
|
<p class="help is-danger" v-if="emptyCommentError">
|
|
|
|
{{ $t("Comment text can't be empty") }}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="field notify-participants" v-if="isEventOrganiser">
|
2021-10-10 16:24:12 +02:00
|
|
|
<b-switch
|
|
|
|
aria-labelledby="notify-participants-toggle"
|
|
|
|
v-model="newComment.isAnnouncement"
|
|
|
|
>{{ $t("Notify participants") }}</b-switch
|
|
|
|
>
|
2021-06-01 18:08:03 +02:00
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2019-11-15 18:36:47 +01:00
|
|
|
</div>
|
2021-06-01 18:08:03 +02:00
|
|
|
<div class="send-comment">
|
|
|
|
<b-button
|
|
|
|
native-type="submit"
|
|
|
|
type="is-primary"
|
|
|
|
class="comment-button-submit"
|
|
|
|
icon-left="send"
|
2021-11-13 12:33:39 +01:00
|
|
|
>{{ $t("Send") }}</b-button
|
|
|
|
>
|
2021-06-01 18:08:03 +02:00
|
|
|
</div>
|
2020-02-18 08:57:00 +01:00
|
|
|
</article>
|
|
|
|
</form>
|
2021-03-31 14:51:36 +02:00
|
|
|
<b-notification v-else-if="isConnected" :closable="false">{{
|
2020-10-20 10:59:56 +02:00
|
|
|
$t("The organiser has chosen to close comments.")
|
|
|
|
}}</b-notification>
|
2020-12-04 15:07:27 +01:00
|
|
|
<p
|
|
|
|
v-if="$apollo.queries.comments.loading"
|
|
|
|
class="loading has-text-centered"
|
|
|
|
>
|
|
|
|
{{ $t("Loading comments…") }}
|
|
|
|
</p>
|
2021-11-07 14:59:20 +01:00
|
|
|
<transition-group tag="div" name="comment-empty-list" v-else>
|
2020-11-30 10:24:11 +01:00
|
|
|
<transition-group
|
2021-04-30 08:03:30 +02:00
|
|
|
key="list"
|
2020-11-30 10:24:11 +01:00
|
|
|
name="comment-list"
|
2021-11-13 12:33:39 +01:00
|
|
|
v-if="filteredOrderedComments.length"
|
2020-11-30 10:24:11 +01:00
|
|
|
class="comment-list"
|
|
|
|
tag="ul"
|
|
|
|
>
|
2020-02-18 08:57:00 +01:00
|
|
|
<comment
|
|
|
|
class="root-comment"
|
|
|
|
:comment="comment"
|
|
|
|
:event="event"
|
|
|
|
v-for="comment in filteredOrderedComments"
|
|
|
|
:key="comment.id"
|
|
|
|
@create-comment="createCommentForEvent"
|
|
|
|
@delete-comment="deleteComment"
|
|
|
|
/>
|
|
|
|
</transition-group>
|
2021-11-13 12:33:39 +01:00
|
|
|
<empty-content v-else icon="comment" key="no-comments" :inline="true">
|
2020-02-18 08:57:00 +01:00
|
|
|
<span>{{ $t("No comments yet") }}</span>
|
2021-11-13 12:33:39 +01:00
|
|
|
</empty-content>
|
2021-04-30 08:03:30 +02:00
|
|
|
</transition-group>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2019-11-15 18:36:47 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-02-18 08:57:00 +01:00
|
|
|
import { Prop, Vue, Component, Watch } from "vue-property-decorator";
|
|
|
|
import Comment from "@/components/Comment/Comment.vue";
|
|
|
|
import IdentityPickerWrapper from "@/views/Account/IdentityPickerWrapper.vue";
|
2020-11-27 19:27:44 +01:00
|
|
|
import { CommentModeration } from "@/types/enums";
|
2020-02-18 08:57:00 +01:00
|
|
|
import { CommentModel, IComment } from "../../types/comment.model";
|
2019-11-15 18:36:47 +01:00
|
|
|
import {
|
2020-02-18 08:57:00 +01:00
|
|
|
CREATE_COMMENT_FROM_EVENT,
|
|
|
|
DELETE_COMMENT,
|
2021-05-17 11:36:28 +02:00
|
|
|
COMMENTS_THREADS_WITH_REPLIES,
|
2020-02-18 08:57:00 +01:00
|
|
|
} from "../../graphql/comment";
|
|
|
|
import { CURRENT_ACTOR_CLIENT } from "../../graphql/actor";
|
|
|
|
import { IPerson } from "../../types/actor";
|
2020-11-06 11:34:32 +01:00
|
|
|
import { IEvent } from "../../types/event.model";
|
2021-05-12 18:10:07 +02:00
|
|
|
import { ApolloCache, FetchResult, InMemoryCache } from "@apollo/client/core";
|
2021-11-13 12:33:39 +01:00
|
|
|
import EmptyContent from "@/components/Utils/EmptyContent.vue";
|
2019-11-15 18:36:47 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
apollo: {
|
2021-06-04 20:24:43 +02:00
|
|
|
currentActor: CURRENT_ACTOR_CLIENT,
|
2019-11-15 18:36:47 +01:00
|
|
|
comments: {
|
2021-05-17 11:36:28 +02:00
|
|
|
query: COMMENTS_THREADS_WITH_REPLIES,
|
2019-11-15 18:36:47 +01:00
|
|
|
variables() {
|
|
|
|
return {
|
|
|
|
eventUUID: this.event.uuid,
|
|
|
|
};
|
|
|
|
},
|
2021-06-11 15:08:43 +02:00
|
|
|
update: (data) => data.event.comments,
|
2019-11-15 18:36:47 +01:00
|
|
|
skip() {
|
|
|
|
return !this.event.uuid;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
Comment,
|
|
|
|
IdentityPickerWrapper,
|
2021-11-13 12:33:39 +01:00
|
|
|
EmptyContent,
|
2020-11-30 10:24:11 +01:00
|
|
|
editor: () =>
|
|
|
|
import(/* webpackChunkName: "editor" */ "@/components/Editor.vue"),
|
2019-11-15 18:36:47 +01:00
|
|
|
},
|
|
|
|
})
|
|
|
|
export default class CommentTree extends Vue {
|
|
|
|
@Prop({ required: false, type: Object }) event!: IEvent;
|
|
|
|
|
|
|
|
newComment: IComment = new CommentModel();
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-11-15 18:36:47 +01:00
|
|
|
currentActor!: IPerson;
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-11-15 18:36:47 +01:00
|
|
|
comments: IComment[] = [];
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-11-15 18:36:47 +01:00
|
|
|
CommentModeration = CommentModeration;
|
|
|
|
|
2021-03-25 12:11:49 +01:00
|
|
|
emptyCommentError = false;
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
@Watch("currentActor")
|
2020-09-29 09:53:48 +02:00
|
|
|
watchCurrentActor(currentActor: IPerson): void {
|
2019-11-15 18:36:47 +01:00
|
|
|
this.newComment.actor = currentActor;
|
|
|
|
}
|
|
|
|
|
2021-03-25 12:11:49 +01:00
|
|
|
@Watch("newComment", { deep: true })
|
|
|
|
resetEmptyCommentError(newComment: IComment): void {
|
|
|
|
if (this.emptyCommentError) {
|
|
|
|
this.emptyCommentError = ["", "<p></p>"].includes(newComment.text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-29 09:53:48 +02:00
|
|
|
async createCommentForEvent(comment: IComment): Promise<void> {
|
2021-03-25 12:11:49 +01:00
|
|
|
this.emptyCommentError = ["", "<p></p>"].includes(comment.text);
|
|
|
|
if (this.emptyCommentError) return;
|
2019-11-15 18:36:47 +01:00
|
|
|
try {
|
2020-08-14 11:32:23 +02:00
|
|
|
if (!comment.actor) return;
|
2019-11-15 18:36:47 +01:00
|
|
|
await this.$apollo.mutate({
|
|
|
|
mutation: CREATE_COMMENT_FROM_EVENT,
|
|
|
|
variables: {
|
|
|
|
eventId: this.event.id,
|
|
|
|
text: comment.text,
|
2020-11-30 10:24:11 +01:00
|
|
|
inReplyToCommentId: comment.inReplyToComment
|
|
|
|
? comment.inReplyToComment.id
|
|
|
|
: null,
|
2021-06-01 18:08:03 +02:00
|
|
|
isAnnouncement: comment.isAnnouncement,
|
2019-11-15 18:36:47 +01:00
|
|
|
},
|
2021-05-12 18:10:07 +02:00
|
|
|
update: (store: ApolloCache<InMemoryCache>, { data }: FetchResult) => {
|
2019-11-15 18:36:47 +01:00
|
|
|
if (data == null) return;
|
|
|
|
// comments are attached to the event, so we can pass it to replies later
|
2021-05-17 11:36:28 +02:00
|
|
|
const newComment = { ...data.createComment, event: this.event };
|
2019-11-15 18:36:47 +01:00
|
|
|
|
|
|
|
// we load all existing threads
|
|
|
|
const commentThreadsData = store.readQuery<{ event: IEvent }>({
|
2021-05-17 11:36:28 +02:00
|
|
|
query: COMMENTS_THREADS_WITH_REPLIES,
|
2019-11-15 18:36:47 +01:00
|
|
|
variables: {
|
|
|
|
eventUUID: this.event.uuid,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
if (!commentThreadsData) return;
|
|
|
|
const { event } = commentThreadsData;
|
2021-05-17 11:36:28 +02:00
|
|
|
const oldComments = [...event.comments];
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
// if it's no a root comment, we first need to find
|
|
|
|
// existing replies and add the new reply to it
|
|
|
|
if (comment.originComment !== undefined) {
|
|
|
|
const { originComment } = comment;
|
|
|
|
const parentCommentIndex = oldComments.findIndex(
|
|
|
|
(oldComment) => oldComment.id === originComment.id
|
|
|
|
);
|
2019-11-15 18:36:47 +01:00
|
|
|
const parentComment = oldComments[parentCommentIndex];
|
|
|
|
|
2021-05-17 11:36:28 +02:00
|
|
|
// replace the root comment with has the updated list of replies in the thread list
|
|
|
|
oldComments.splice(parentCommentIndex, 1, {
|
|
|
|
...parentComment,
|
|
|
|
replies: [...parentComment.replies, newComment],
|
|
|
|
});
|
2019-11-15 18:36:47 +01:00
|
|
|
} else {
|
|
|
|
// otherwise it's simply a new thread and we add it to the list
|
|
|
|
oldComments.push(newComment);
|
|
|
|
}
|
|
|
|
|
|
|
|
// finally we save the thread list
|
|
|
|
store.writeQuery({
|
2021-05-17 11:36:28 +02:00
|
|
|
query: COMMENTS_THREADS_WITH_REPLIES,
|
|
|
|
data: {
|
|
|
|
event: {
|
|
|
|
...event,
|
|
|
|
comments: oldComments,
|
|
|
|
},
|
|
|
|
},
|
2019-11-15 18:36:47 +01:00
|
|
|
variables: {
|
|
|
|
eventUUID: this.event.uuid,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
// and reset the new comment field
|
|
|
|
this.newComment = new CommentModel();
|
2021-09-29 18:20:33 +02:00
|
|
|
} catch (errors: any) {
|
2021-03-25 12:11:49 +01:00
|
|
|
console.error(errors);
|
|
|
|
if (errors.graphQLErrors && errors.graphQLErrors.length > 0) {
|
|
|
|
const error = errors.graphQLErrors[0];
|
|
|
|
if (error.field !== "text" && error.message[0] !== "can't be blank") {
|
|
|
|
this.$notifier.error(error.message);
|
|
|
|
}
|
2020-10-05 17:42:53 +02:00
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-29 09:53:48 +02:00
|
|
|
async deleteComment(comment: IComment): Promise<void> {
|
|
|
|
try {
|
|
|
|
await this.$apollo.mutate({
|
|
|
|
mutation: DELETE_COMMENT,
|
|
|
|
variables: {
|
|
|
|
commentId: comment.id,
|
|
|
|
},
|
2021-05-12 18:10:07 +02:00
|
|
|
update: (store: ApolloCache<InMemoryCache>, { data }: FetchResult) => {
|
2020-09-29 09:53:48 +02:00
|
|
|
if (data == null) return;
|
|
|
|
const deletedCommentId = data.deleteComment.id;
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-09-29 09:53:48 +02:00
|
|
|
const commentsData = store.readQuery<{ event: IEvent }>({
|
2021-05-17 11:36:28 +02:00
|
|
|
query: COMMENTS_THREADS_WITH_REPLIES,
|
2019-11-15 18:36:47 +01:00
|
|
|
variables: {
|
2020-09-29 09:53:48 +02:00
|
|
|
eventUUID: this.event.uuid,
|
2019-11-15 18:36:47 +01:00
|
|
|
},
|
|
|
|
});
|
2020-09-29 09:53:48 +02:00
|
|
|
if (!commentsData) return;
|
|
|
|
const { event } = commentsData;
|
2021-05-17 11:36:28 +02:00
|
|
|
let updatedComments: IComment[] = [...event.comments];
|
2020-09-29 09:53:48 +02:00
|
|
|
|
|
|
|
if (comment.originComment) {
|
|
|
|
// we have deleted a reply to a thread
|
|
|
|
const { originComment } = comment;
|
|
|
|
|
2021-05-17 11:36:28 +02:00
|
|
|
const parentCommentIndex = updatedComments.findIndex(
|
2020-09-29 09:53:48 +02:00
|
|
|
(oldComment) => oldComment.id === originComment.id
|
|
|
|
);
|
2021-05-17 11:36:28 +02:00
|
|
|
const parentComment = updatedComments[parentCommentIndex];
|
|
|
|
const updatedReplies = parentComment.replies.map((reply) => {
|
|
|
|
if (reply.id === deletedCommentId) {
|
|
|
|
return {
|
|
|
|
...reply,
|
|
|
|
deletedAt: new Date().toString(),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return reply;
|
|
|
|
});
|
|
|
|
updatedComments.splice(parentCommentIndex, 1, {
|
|
|
|
...parentComment,
|
|
|
|
replies: updatedReplies,
|
|
|
|
totalReplies: parentComment.totalReplies - 1,
|
|
|
|
});
|
|
|
|
console.log("updatedComments", updatedComments);
|
2020-09-29 09:53:48 +02:00
|
|
|
} else {
|
|
|
|
// we have deleted a thread itself
|
2021-05-17 11:36:28 +02:00
|
|
|
updatedComments = updatedComments.map((reply) => {
|
|
|
|
if (reply.id === deletedCommentId) {
|
|
|
|
return {
|
|
|
|
...reply,
|
|
|
|
deletedAt: new Date().toString(),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return reply;
|
|
|
|
});
|
2020-09-29 09:53:48 +02:00
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
store.writeQuery({
|
2021-05-17 11:36:28 +02:00
|
|
|
query: COMMENTS_THREADS_WITH_REPLIES,
|
2019-11-15 18:36:47 +01:00
|
|
|
variables: {
|
2020-09-29 09:53:48 +02:00
|
|
|
eventUUID: this.event.uuid,
|
2019-11-15 18:36:47 +01:00
|
|
|
},
|
2021-05-17 11:36:28 +02:00
|
|
|
data: {
|
|
|
|
event: {
|
|
|
|
...event,
|
|
|
|
comments: updatedComments,
|
|
|
|
},
|
|
|
|
},
|
2019-11-15 18:36:47 +01:00
|
|
|
});
|
2020-09-29 09:53:48 +02:00
|
|
|
},
|
|
|
|
});
|
|
|
|
// this.comments = this.comments.filter(commentItem => commentItem.id !== comment.id);
|
2021-09-29 18:20:33 +02:00
|
|
|
} catch (error: any) {
|
2020-10-05 17:42:53 +02:00
|
|
|
console.error(error);
|
|
|
|
if (error.graphQLErrors && error.graphQLErrors.length > 0) {
|
|
|
|
this.$notifier.error(error.graphQLErrors[0].message);
|
|
|
|
}
|
2020-09-29 09:53:48 +02:00
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
get orderedComments(): IComment[] {
|
2020-02-18 08:57:00 +01:00
|
|
|
return this.comments
|
|
|
|
.filter((comment) => comment.inReplyToComment == null)
|
|
|
|
.sort((a, b) => {
|
2021-06-10 10:02:43 +02:00
|
|
|
if (a.isAnnouncement !== b.isAnnouncement) {
|
|
|
|
return (
|
|
|
|
(b.isAnnouncement === true ? 1 : 0) -
|
|
|
|
(a.isAnnouncement === true ? 1 : 0)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
if (a.publishedAt && b.publishedAt) {
|
|
|
|
return (
|
|
|
|
new Date(b.publishedAt).getTime() -
|
|
|
|
new Date(a.publishedAt).getTime()
|
|
|
|
);
|
|
|
|
} else if (a.updatedAt && b.updatedAt) {
|
2020-11-30 10:24:11 +01:00
|
|
|
return (
|
|
|
|
new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime()
|
|
|
|
);
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
get filteredOrderedComments(): IComment[] {
|
2020-11-30 10:24:11 +01:00
|
|
|
return this.orderedComments.filter(
|
|
|
|
(comment) => !comment.deletedAt || comment.totalReplies > 0
|
|
|
|
);
|
2019-11-15 18:36:47 +01:00
|
|
|
}
|
2020-10-05 17:42:53 +02:00
|
|
|
|
2020-10-20 10:59:56 +02:00
|
|
|
get isEventOrganiser(): boolean {
|
2021-02-05 14:45:39 +01:00
|
|
|
const organizerId =
|
|
|
|
this.event?.organizerActor?.id || this.event?.attributedTo?.id;
|
|
|
|
return organizerId !== undefined && this.currentActor?.id === organizerId;
|
2020-10-20 10:59:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
get areCommentsClosed(): boolean {
|
|
|
|
return (
|
|
|
|
this.currentActor.id !== undefined &&
|
|
|
|
this.event.options.commentModeration !== CommentModeration.CLOSED
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-10-05 17:42:53 +02:00
|
|
|
get isAbleToComment(): boolean {
|
2021-03-31 14:51:36 +02:00
|
|
|
if (this.isConnected) {
|
2020-10-20 10:59:56 +02:00
|
|
|
return this.areCommentsClosed || this.isEventOrganiser;
|
2020-10-05 17:42:53 +02:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2021-03-31 14:51:36 +02:00
|
|
|
|
|
|
|
get isConnected(): boolean {
|
|
|
|
return this.currentActor?.id != undefined;
|
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-11-04 18:14:36 +01:00
|
|
|
@use "@/styles/_mixins" as *;
|
2021-11-13 12:33:39 +01:00
|
|
|
@import "~bulma/sass/utilities/mixins.sass";
|
2020-02-18 08:57:00 +01:00
|
|
|
form.new-comment {
|
|
|
|
padding-bottom: 1rem;
|
|
|
|
|
2021-11-13 12:33:39 +01:00
|
|
|
.media {
|
|
|
|
flex-wrap: wrap;
|
|
|
|
justify-content: center;
|
|
|
|
.media-left {
|
|
|
|
@include mobile {
|
|
|
|
@include margin-right(0.5rem);
|
|
|
|
@include margin-left(0.5rem);
|
|
|
|
}
|
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2021-11-13 12:33:39 +01:00
|
|
|
.media-content {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
align-content: center;
|
|
|
|
width: min-content;
|
2021-06-01 18:08:03 +02:00
|
|
|
|
2021-11-13 12:33:39 +01:00
|
|
|
.field {
|
|
|
|
flex: 1;
|
|
|
|
@include padding-right(10px);
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
|
|
|
&.notify-participants {
|
|
|
|
margin-top: 0.5rem;
|
|
|
|
}
|
2021-06-01 18:08:03 +02:00
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.no-comments {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
span {
|
|
|
|
text-align: center;
|
|
|
|
margin-bottom: 10px;
|
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
img {
|
|
|
|
max-width: 250px;
|
|
|
|
align-self: center;
|
|
|
|
}
|
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
ul.comment-list li {
|
|
|
|
margin-bottom: 16px;
|
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.comment-list-enter-active,
|
|
|
|
.comment-list-leave-active,
|
|
|
|
.comment-list-move {
|
|
|
|
transition: 500ms cubic-bezier(0.59, 0.12, 0.34, 0.95);
|
|
|
|
transition-property: opacity, transform;
|
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.comment-list-enter {
|
|
|
|
opacity: 0;
|
|
|
|
transform: translateX(50px) scaleY(0.5);
|
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.comment-list-enter-to {
|
|
|
|
opacity: 1;
|
|
|
|
transform: translateX(0) scaleY(1);
|
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.comment-list-leave-active,
|
|
|
|
.comment-empty-list-active {
|
|
|
|
position: absolute;
|
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
.comment-list-leave-to,
|
|
|
|
.comment-empty-list-leave-to {
|
|
|
|
opacity: 0;
|
|
|
|
transform: scaleY(0);
|
|
|
|
transform-origin: center top;
|
|
|
|
}
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
/*.comment-empty-list-enter-active {*/
|
|
|
|
/* transition: opacity .5s;*/
|
|
|
|
/*}*/
|
2019-11-15 18:36:47 +01:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
/*.comment-empty-list-enter {*/
|
|
|
|
/* opacity: 0;*/
|
|
|
|
/*}*/
|
2019-11-15 18:36:47 +01:00
|
|
|
</style>
|