Add placeholder for comments sort

This commit is contained in:
Preston 2020-10-04 18:15:06 -04:00
parent e47b59750d
commit 2770818668
4 changed files with 41 additions and 2 deletions

View File

@ -12,6 +12,10 @@
text-align: center;
}
.commentSort {
float: right;
}
.comment {
padding: 15px;
position: relative;

View File

@ -2,14 +2,17 @@ import Vue from 'vue'
import { mapActions } from 'vuex'
import FtCard from '../ft-card/ft-card.vue'
import FtLoader from '../../components/ft-loader/ft-loader.vue'
import CommentScraper from 'yt-comment-scraper'
import FtSelect from '../../components/ft-select/ft-select.vue'
import FtTimestampCatcher from '../../components/ft-timestamp-catcher/ft-timestamp-catcher.vue'
import CommentScraper from 'yt-comment-scraper'
export default Vue.extend({
name: 'WatchVideoComments',
components: {
'ft-card': FtCard,
'ft-loader': FtLoader,
'ft-select': FtSelect,
'ft-timestamp-catcher': FtTimestampCatcher
},
props: {
@ -38,13 +41,34 @@ export default Vue.extend({
invidiousInstance: function () {
return this.$store.getters.getInvidiousInstance
},
sortNames: function () {
return [
this.$t('Comments.Top comments'),
this.$t('Comments.Newest first')
]
},
sortValues: function () {
return [
'top',
'newest'
]
}
},
methods: {
onTimestamp: function(timestamp) {
onTimestamp: function (timestamp) {
this.$emit('timestamp-event', timestamp)
},
handleSortChange: function (sortType) {
console.log(sortType)
this.showToast({
message: 'Not currently implemented'
})
},
getCommentData: function () {
this.isLoading = true
switch (this.backendPreference) {

View File

@ -17,6 +17,15 @@
>
{{ $t("Comments.Click to View Comments") }}
</h4>
<ft-select
v-if="commentData.length > 0 && !isLoading && showComments"
class="commentSort"
placeholder="Sort by"
:value="sortValues[0]"
:select-names="sortNames"
:select-values="sortValues"
@change="handleSortChange"
/>
<h3
v-if="commentData.length > 0 && !isLoading && showComments"
>

View File

@ -478,6 +478,8 @@ Comments:
There are no more comments for this video: There are no more comments for this video
Show Comments: Show Comments
Hide Comments: Hide Comments
Top comments: Top comments
Newest first: Newest First
# Context: View 10 Replies, View 1 Reply
View: View
Hide: Hide