2022-04-19 14:03:46 +00:00
|
|
|
<template>
|
2022-05-05 03:57:37 +00:00
|
|
|
<div
|
2022-05-13 19:54:14 +00:00
|
|
|
v-if="commentRenderer"
|
2022-05-05 05:32:02 +00:00
|
|
|
v-ripple
|
|
|
|
class="comment-thread px-3"
|
2022-05-05 03:57:37 +00:00
|
|
|
@click="$emit('showReplies', comment)"
|
|
|
|
>
|
2022-04-19 14:03:46 +00:00
|
|
|
<a
|
|
|
|
:href="
|
|
|
|
this.$rendererUtils.getNavigationEndpoints(
|
|
|
|
commentRenderer.authorEndpoint
|
|
|
|
)
|
|
|
|
"
|
|
|
|
class="avatar-link"
|
|
|
|
>
|
|
|
|
<v-img
|
|
|
|
class="avatar-thumbnail"
|
|
|
|
:src="
|
|
|
|
commentRenderer.authorThumbnail.thumbnails[
|
|
|
|
commentRenderer.authorThumbnail.thumbnails.length - 1
|
|
|
|
].url
|
|
|
|
"
|
|
|
|
/>
|
|
|
|
</a>
|
|
|
|
<div class="comment-content">
|
2022-04-21 09:22:40 +00:00
|
|
|
<div class="comment-content--header subtitle-2">
|
2022-04-21 10:51:49 +00:00
|
|
|
<div
|
|
|
|
class="author-badge-name mr-1"
|
2022-05-13 19:54:14 +00:00
|
|
|
:class="
|
|
|
|
commentRenderer.authorIsChannelOwner
|
|
|
|
? $vuetify.theme.dark
|
|
|
|
? 'owner background lighten-2'
|
|
|
|
: 'owner primary lighten-3'
|
|
|
|
: ''
|
|
|
|
"
|
2022-04-21 10:51:49 +00:00
|
|
|
>
|
2022-04-21 09:22:40 +00:00
|
|
|
<div class="author-name--wrapper">
|
|
|
|
<span class="font-weight-bold author-name" v-emoji>
|
|
|
|
{{ commentRenderer.authorText.simpleText }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<template
|
|
|
|
v-for="(badge, index) in commentRenderer.authorCommentBadge"
|
|
|
|
>
|
|
|
|
<author-comment-badge-renderer
|
|
|
|
:metadata="badge"
|
|
|
|
:key="index"
|
|
|
|
class="ml-1"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
<template
|
|
|
|
v-for="(badge, index) in commentRenderer.sponsorCommentBadge"
|
|
|
|
>
|
|
|
|
<sponsor-comment-badge-renderer
|
|
|
|
:metadata="badge"
|
|
|
|
:key="index"
|
|
|
|
class="ml-1"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</div>
|
2022-04-19 14:03:46 +00:00
|
|
|
<span
|
|
|
|
:class="$vuetify.theme.dark ? 'text--lighten-4' : 'text--darken-4'"
|
2022-04-21 09:22:40 +00:00
|
|
|
class="background--text comment-timestamp"
|
2022-04-19 14:03:46 +00:00
|
|
|
>
|
|
|
|
{{ commentRenderer.publishedTimeText.runs[0].text }}
|
|
|
|
</span>
|
|
|
|
</div>
|
2022-04-22 09:06:31 +00:00
|
|
|
<collapsable-text
|
|
|
|
:lines="4"
|
|
|
|
:expandText="
|
|
|
|
commentRenderer.expandButton.buttonRenderer.text.runs[0].text
|
|
|
|
"
|
|
|
|
:collapseText="
|
|
|
|
commentRenderer.collapseButton.buttonRenderer.text.runs[0].text
|
|
|
|
"
|
|
|
|
>
|
2022-04-21 02:38:22 +00:00
|
|
|
<yt-text-formatter :textRuns="commentRenderer.contentText.runs">
|
|
|
|
</yt-text-formatter>
|
2022-04-20 12:50:00 +00:00
|
|
|
</collapsable-text>
|
2022-04-22 04:38:21 +00:00
|
|
|
<div class="toolbar">
|
2022-04-22 09:06:31 +00:00
|
|
|
<v-btn-toggle v-model="voteStatus" group>
|
2022-04-23 04:18:59 +00:00
|
|
|
<div class="toolbar--item mr-1">
|
2022-04-22 09:06:31 +00:00
|
|
|
<v-btn class="toolbar--button like" disabled icon x-small plain>
|
|
|
|
<v-icon small>mdi-thumb-up</v-icon>
|
|
|
|
</v-btn>
|
|
|
|
<span
|
2022-04-23 04:10:46 +00:00
|
|
|
v-if="commentRenderer.voteCount"
|
2022-04-22 09:06:31 +00:00
|
|
|
v-text="commentRenderer.voteCount.simpleText"
|
2022-04-23 04:18:59 +00:00
|
|
|
class="like-count subtitle-2"
|
2022-04-22 09:06:31 +00:00
|
|
|
></span>
|
|
|
|
</div>
|
|
|
|
<div class="toolbar--item">
|
|
|
|
<v-btn class="toolbar--button dislike" disabled icon x-small plain>
|
|
|
|
<v-icon small>mdi-thumb-down</v-icon>
|
|
|
|
</v-btn>
|
|
|
|
</div>
|
|
|
|
</v-btn-toggle>
|
2022-04-22 04:38:21 +00:00
|
|
|
<div class="toolbar--item">
|
2022-04-22 09:06:31 +00:00
|
|
|
<v-btn class="toolbar--button reply ml-2" disabled icon x-small plain>
|
|
|
|
<v-icon small>mdi-comment</v-icon>
|
2022-04-22 04:38:21 +00:00
|
|
|
</v-btn>
|
|
|
|
</div>
|
2022-04-22 09:06:31 +00:00
|
|
|
<div class="toolbar--item" v-if="commentRenderer.replyCount">
|
2022-04-22 04:38:21 +00:00
|
|
|
<span
|
2022-04-22 09:06:31 +00:00
|
|
|
v-text="commentRenderer.replyCount"
|
2022-04-22 04:38:21 +00:00
|
|
|
class="like-count mr-1 subtitle-2"
|
|
|
|
></span>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-04-19 14:03:46 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-04-20 12:50:00 +00:00
|
|
|
<style scoped lang="scss">
|
2022-04-19 14:03:46 +00:00
|
|
|
.entry {
|
|
|
|
width: 100%; /* Prevent Loading Weirdness */
|
|
|
|
}
|
|
|
|
|
|
|
|
.comment-thread {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-basis: auto;
|
|
|
|
width: 100%;
|
2022-04-20 12:50:00 +00:00
|
|
|
padding: 10px 0;
|
2022-04-19 14:03:46 +00:00
|
|
|
|
2022-04-20 12:50:00 +00:00
|
|
|
.avatar-thumbnail {
|
|
|
|
margin-right: 0.5rem;
|
|
|
|
border-radius: 50%;
|
|
|
|
width: 48px;
|
|
|
|
height: 48px;
|
|
|
|
}
|
2022-04-19 14:03:46 +00:00
|
|
|
|
2022-04-20 12:50:00 +00:00
|
|
|
.comment-content {
|
|
|
|
min-width: 0;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
flex-basis: auto;
|
|
|
|
flex-grow: 1;
|
|
|
|
|
|
|
|
.comment-content--header {
|
|
|
|
display: flex;
|
|
|
|
align-items: baseline;
|
|
|
|
|
|
|
|
.comment-timestamp {
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-04-19 14:03:46 +00:00
|
|
|
}
|
2022-04-21 09:22:40 +00:00
|
|
|
|
2022-04-22 04:38:21 +00:00
|
|
|
.toolbar {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
2022-04-21 09:22:40 +00:00
|
|
|
.author-badge-name {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
2022-04-21 10:51:49 +00:00
|
|
|
min-width: 0;
|
2022-04-21 09:22:40 +00:00
|
|
|
|
|
|
|
.author-name--wrapper {
|
|
|
|
min-width: 0;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
}
|
2022-04-21 10:51:49 +00:00
|
|
|
|
|
|
|
.owner {
|
2022-05-13 19:54:14 +00:00
|
|
|
color: var(--v-primary-base);
|
2022-04-21 10:51:49 +00:00
|
|
|
border-radius: 1em;
|
2022-05-13 19:54:14 +00:00
|
|
|
padding: 0 0.3em 0 0.6em;
|
2022-04-21 10:51:49 +00:00
|
|
|
|
|
|
|
&::v-deep .author-badge {
|
2022-05-13 19:54:14 +00:00
|
|
|
color: var(--v-primary-base);
|
2022-04-21 10:51:49 +00:00
|
|
|
}
|
|
|
|
}
|
2022-04-22 09:06:31 +00:00
|
|
|
|
|
|
|
.toolbar--button::v-deep.v-btn--active .v-btn__content {
|
|
|
|
color: var(--v-primary-base);
|
|
|
|
}
|
2022-04-19 14:03:46 +00:00
|
|
|
</style>
|
|
|
|
|
|
|
|
<script>
|
2022-04-20 12:50:00 +00:00
|
|
|
import collapsableText from "~/components/UtilRenderers/collapsableText.vue";
|
2022-04-21 02:38:22 +00:00
|
|
|
import YtTextFormatter from "~/components/UtilRenderers/YtTextFormatter.vue";
|
2022-04-21 09:22:40 +00:00
|
|
|
import AuthorCommentBadgeRenderer from "~/components/Comments/authorCommentBadgeRenderer.vue";
|
|
|
|
import SponsorCommentBadgeRenderer from "~/components/Comments/sponsorCommentBadgeRenderer.vue";
|
2022-04-21 02:38:22 +00:00
|
|
|
|
2022-04-19 14:03:46 +00:00
|
|
|
export default {
|
2022-04-21 09:22:40 +00:00
|
|
|
components: {
|
|
|
|
collapsableText,
|
|
|
|
YtTextFormatter,
|
|
|
|
AuthorCommentBadgeRenderer,
|
|
|
|
SponsorCommentBadgeRenderer,
|
|
|
|
},
|
2022-04-19 14:03:46 +00:00
|
|
|
props: ["comment"],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
commentRenderer: null,
|
2022-04-22 09:06:31 +00:00
|
|
|
voteStatus: null,
|
2022-04-19 14:03:46 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
this.commentRenderer = this.comment?.comment?.commentRenderer;
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|