mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-26 15:37:24 +00:00
Implement comment replies.
This commit is contained in:
parent
4b35b6925d
commit
8ea56aa0b9
@ -3,6 +3,8 @@
|
|||||||
<img
|
<img
|
||||||
:src="comment.thumbnail"
|
:src="comment.thumbnail"
|
||||||
class="comment-avatar uk-border-circle uk-margin-right"
|
class="comment-avatar uk-border-circle uk-margin-right"
|
||||||
|
height="48"
|
||||||
|
width="48"
|
||||||
style="width: 48px; height: 48px"
|
style="width: 48px; height: 48px"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
alt="Avatar"
|
alt="Avatar"
|
||||||
@ -33,6 +35,28 @@
|
|||||||
|
|
||||||
<font-awesome-icon v-if="comment.hearted" icon="heart"></font-awesome-icon>
|
<font-awesome-icon v-if="comment.hearted" icon="heart"></font-awesome-icon>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="comment.repliesPage && notLoading">
|
||||||
|
<div @click="loadReplies">
|
||||||
|
<a class="uk-link-text">Show Replies</a>
|
||||||
|
|
||||||
|
<font-awesome-icon icon="level-down-alt"></font-awesome-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="replies" class="replies uk-width-4-5@xl uk-width-3-4@s uk-width-1">
|
||||||
|
<div
|
||||||
|
v-for="reply in replies"
|
||||||
|
:key="reply.commentId"
|
||||||
|
class="uk-tile-default uk-align-left uk-width-expand"
|
||||||
|
:style="[{ background: backgroundColor }]"
|
||||||
|
>
|
||||||
|
<Comment :comment="reply" :uploader="uploader" :video-id="videoId" />
|
||||||
|
</div>
|
||||||
|
<div v-if="nextpage" @click="loadReplies">
|
||||||
|
<a class="uk-link-text">Load more Replies</a>
|
||||||
|
|
||||||
|
<font-awesome-icon icon="level-down-alt"></font-awesome-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -47,6 +71,25 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
uploader: { type: String, default: null },
|
uploader: { type: String, default: null },
|
||||||
|
videoId: { type: String, default: null },
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
notLoading: true,
|
||||||
|
replies: [],
|
||||||
|
nextpage: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
loadReplies() {
|
||||||
|
this.notLoading = false;
|
||||||
|
this.fetchJson(this.apiUrl() + "/nextpage/comments/" + this.videoId, {
|
||||||
|
nextpage: this.nextpage || this.comment.repliesPage,
|
||||||
|
}).then(json => {
|
||||||
|
this.replies = this.replies.concat(json.comments);
|
||||||
|
this.nextpage = json.nextpage;
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -123,7 +123,7 @@
|
|||||||
class="uk-tile-default uk-align-left uk-width-expand"
|
class="uk-tile-default uk-align-left uk-width-expand"
|
||||||
:style="[{ background: backgroundColor }]"
|
:style="[{ background: backgroundColor }]"
|
||||||
>
|
>
|
||||||
<Comment :comment="comment" :uploader="video.uploader" />
|
<Comment :comment="comment" :uploader="video.uploader" :video-id="getVideoId()" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import {
|
|||||||
faHeadphones,
|
faHeadphones,
|
||||||
faRss,
|
faRss,
|
||||||
faChevronLeft,
|
faChevronLeft,
|
||||||
|
faLevelDownAlt,
|
||||||
faTv,
|
faTv,
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
import { faGithub, faBitcoin, faYoutube } from "@fortawesome/free-brands-svg-icons";
|
import { faGithub, faBitcoin, faYoutube } from "@fortawesome/free-brands-svg-icons";
|
||||||
@ -27,6 +28,7 @@ library.add(
|
|||||||
faYoutube,
|
faYoutube,
|
||||||
faRss,
|
faRss,
|
||||||
faChevronLeft,
|
faChevronLeft,
|
||||||
|
faLevelDownAlt,
|
||||||
faTv,
|
faTv,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user