mirror of
https://github.com/VueTubeApp/VueTube
synced 2025-01-03 14:11:08 +00:00
fix: comments
This commit is contained in:
parent
f4567d6b95
commit
f3977da8ab
8 changed files with 39 additions and 118 deletions
|
@ -32,7 +32,7 @@
|
||||||
<v-divider v-if="getComponents()[Object.keys(comment)[0]]"></v-divider>
|
<v-divider v-if="getComponents()[Object.keys(comment)[0]]"></v-divider>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="loading" v-if="loading">
|
<div v-if="loading" class="loading">
|
||||||
<v-sheet
|
<v-sheet
|
||||||
v-for="i in comments.length <= 0 ? 5 : 1"
|
v-for="i in comments.length <= 0 ? 5 : 1"
|
||||||
:key="i"
|
:key="i"
|
||||||
|
@ -50,6 +50,7 @@
|
||||||
:defaultContinuation="replyData.replyContinuation"
|
:defaultContinuation="replyData.replyContinuation"
|
||||||
class="transition-fast-in-fast-out v-card--reveal"
|
class="transition-fast-in-fast-out v-card--reveal"
|
||||||
style="height: 100%"
|
style="height: 100%"
|
||||||
|
@closeComments="$emit('changeState', false)"
|
||||||
></main-comment-reply-renderer>
|
></main-comment-reply-renderer>
|
||||||
</template>
|
</template>
|
||||||
</dialog-base>
|
</dialog-base>
|
||||||
|
@ -57,26 +58,24 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import dialogBase from "~/components/dialogBase.vue";
|
import dialogBase from "~/components/dialogBase.vue";
|
||||||
import commentsHeaderRenderer from "~/components/Comments/commentsHeaderRenderer.vue";
|
|
||||||
import commentThreadRenderer from "~/components/Comments/commentThreadRenderer.vue";
|
import commentThreadRenderer from "~/components/Comments/commentThreadRenderer.vue";
|
||||||
import continuationItemRenderer from "~/components/observer.vue";
|
import commentsHeaderRenderer from "~/components/Comments/commentsHeaderRenderer.vue";
|
||||||
import mainCommentReplyRenderer from "~/components/Comments/mainCommentReplyRenderer.vue";
|
import mainCommentReplyRenderer from "~/components/Comments/mainCommentReplyRenderer.vue";
|
||||||
|
import continuationItemRenderer from "~/components/observer.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ["defaultContinuation", "commentData", "showComments"],
|
components: {
|
||||||
|
dialogBase,
|
||||||
|
commentThreadRenderer,
|
||||||
|
commentsHeaderRenderer,
|
||||||
|
mainCommentReplyRenderer,
|
||||||
|
continuationItemRenderer,
|
||||||
|
},
|
||||||
model: {
|
model: {
|
||||||
prop: "showComments",
|
prop: "showComments",
|
||||||
event: "changeState",
|
event: "changeState",
|
||||||
},
|
},
|
||||||
|
props: ["defaultContinuation", "commentData", "showComments"],
|
||||||
components: {
|
|
||||||
dialogBase,
|
|
||||||
commentsHeaderRenderer,
|
|
||||||
commentThreadRenderer,
|
|
||||||
continuationItemRenderer,
|
|
||||||
mainCommentReplyRenderer,
|
|
||||||
},
|
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
loading: true,
|
loading: true,
|
||||||
|
|
|
@ -31,18 +31,16 @@ import commentThreadRenderer from "~/components/Comments/commentThreadRenderer.v
|
||||||
import continuationItemRenderer from "~/components/observer.vue";
|
import continuationItemRenderer from "~/components/observer.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ["defaultContinuation", "parentComment", "showReplies"],
|
|
||||||
|
|
||||||
model: {
|
|
||||||
prop: "showReplies",
|
|
||||||
event: "changeState",
|
|
||||||
},
|
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
dialogBase,
|
dialogBase,
|
||||||
commentsHeaderRenderer,
|
commentsHeaderRenderer,
|
||||||
commentThreadRenderer,
|
commentThreadRenderer,
|
||||||
continuationItemRenderer,
|
continuationItemRenderer,
|
||||||
},
|
},
|
||||||
|
model: {
|
||||||
|
prop: "showReplies",
|
||||||
|
event: "changeState",
|
||||||
|
},
|
||||||
|
props: ["defaultContinuation", "parentComment", "showReplies"],
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
@import "~vuetify/src/styles/settings/_variables";
|
|
||||||
$bottom-sheet-inset-width: 70% !default;
|
|
|
@ -1,4 +0,0 @@
|
||||||
import swipeableBottomSheet from "./swipeableBottomSheet";
|
|
||||||
|
|
||||||
export { swipeableBottomSheet };
|
|
||||||
export default swipeableBottomSheet;
|
|
|
@ -1,34 +0,0 @@
|
||||||
import "./swipeableBottomSheet.sass";
|
|
||||||
|
|
||||||
// Extensions
|
|
||||||
import { VDialog } from "vuetify/lib";
|
|
||||||
|
|
||||||
/* @vue/component */
|
|
||||||
export default VDialog.extend({
|
|
||||||
name: "swipeable-bottom-sheet",
|
|
||||||
|
|
||||||
props: {
|
|
||||||
inset: Boolean,
|
|
||||||
maxWidth: [String, Number],
|
|
||||||
transition: {
|
|
||||||
type: String,
|
|
||||||
default: "bottom-sheet-transition",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
computed: {
|
|
||||||
classes() {
|
|
||||||
return {
|
|
||||||
...VDialog.options.computed.classes.call(this),
|
|
||||||
"swipeable-bottom-sheet": true,
|
|
||||||
"swipeable-bottom-sheet--inset": this.inset,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
contentClasses() {
|
|
||||||
return {
|
|
||||||
"swipeable-bottom-sheet__content": true,
|
|
||||||
"swipeable-bottom-sheet__content--active": this.isActive,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
|
@ -1,44 +0,0 @@
|
||||||
@import './_variables.scss'
|
|
||||||
|
|
||||||
// Transition
|
|
||||||
.bottom-sheet-transition
|
|
||||||
&-enter
|
|
||||||
transform: translateY(100%)
|
|
||||||
|
|
||||||
&-leave-to
|
|
||||||
transform: translateY(100%)
|
|
||||||
|
|
||||||
// Block
|
|
||||||
|
|
||||||
.swipeable-bottom-sheet
|
|
||||||
|
|
||||||
&.v-dialog
|
|
||||||
align-self: flex-end
|
|
||||||
border-radius: 0
|
|
||||||
flex: 0 1 auto
|
|
||||||
margin: 0
|
|
||||||
overflow: visible
|
|
||||||
|
|
||||||
&.swipeable-bottom-sheet--inset
|
|
||||||
max-width: $bottom-sheet-inset-width
|
|
||||||
|
|
||||||
@media #{map-get($display-breakpoints, 'xs-only')}
|
|
||||||
max-width: none
|
|
||||||
|
|
||||||
&.v-dialog:not(.v-dialog--fullscreen)
|
|
||||||
max-height: 100%
|
|
||||||
height: 100%
|
|
||||||
|
|
||||||
.swipeable-bottom-sheet__content
|
|
||||||
align-items: center
|
|
||||||
display: flex
|
|
||||||
justify-content: center
|
|
||||||
pointer-events: none
|
|
||||||
position: absolute
|
|
||||||
transition: .2s map-get($transition, 'fast-in-fast-out'), z-index 1ms
|
|
||||||
width: 100%
|
|
||||||
height: 100%
|
|
||||||
outline: none
|
|
||||||
inset: 0
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
class="toolbar-container d-flex flex-column background"
|
class="toolbar-container d-flex flex-column background"
|
||||||
style="flex-direction: column !important"
|
style="flex-direction: column !important"
|
||||||
>
|
>
|
||||||
<v-toolbar color="background" flat>
|
<v-toolbar color="background" style="position: sticky; top: 0" flat>
|
||||||
<slot name="header"></slot>
|
<slot name="header"></slot>
|
||||||
</v-toolbar>
|
</v-toolbar>
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
|
|
|
@ -241,21 +241,17 @@
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<swipeable-bottom-sheet
|
<div
|
||||||
v-if="loaded && video.commentData"
|
v-if="loaded && video.commentData"
|
||||||
v-model="showComments"
|
:class="showComments ? 'comments-open' : ''"
|
||||||
hide-overlay
|
class="scroll-y comments"
|
||||||
persistent
|
|
||||||
no-click-animation
|
|
||||||
style="z-index: 2 !important"
|
|
||||||
attach="#content-container"
|
|
||||||
>
|
>
|
||||||
<mainCommentRenderer
|
<mainCommentRenderer
|
||||||
v-model="showComments"
|
v-model="showComments"
|
||||||
:comment-data="video.commentData"
|
:comment-data="video.commentData"
|
||||||
:default-continuation="video.commentContinuation"
|
:default-continuation="video.commentContinuation"
|
||||||
></mainCommentRenderer>
|
></mainCommentRenderer>
|
||||||
</swipeable-bottom-sheet>
|
</div>
|
||||||
|
|
||||||
<!-- <swipeable-bottom-sheet
|
<!-- <swipeable-bottom-sheet
|
||||||
:v-model="showComments"
|
:v-model="showComments"
|
||||||
|
@ -281,14 +277,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import player from "~/components/Player/index.vue";
|
|
||||||
import { Share } from "@capacitor/share";
|
import { Share } from "@capacitor/share";
|
||||||
import { getCpn } from "~/plugins/utils";
|
import { getCpn } from "~/plugins/utils";
|
||||||
import ShelfRenderer from "~/components/SectionRenderers/shelfRenderer.vue";
|
import player from "~/components/Player/index.vue";
|
||||||
import VidLoadRenderer from "~/components/vidLoadRenderer.vue";
|
import VidLoadRenderer from "~/components/vidLoadRenderer.vue";
|
||||||
import ItemSectionRenderer from "~/components/SectionRenderers/itemSectionRenderer.vue";
|
import ItemSectionRenderer from "~/components/SectionRenderers/itemSectionRenderer.vue";
|
||||||
import mainCommentRenderer from "~/components/Comments/mainCommentRenderer.vue";
|
import mainCommentRenderer from "~/components/Comments/mainCommentRenderer.vue";
|
||||||
import SwipeableBottomSheet from "~/components/ExtendedComponents/swipeableBottomSheet";
|
|
||||||
import SlimVideoDescriptionRenderer from "~/components/UtilRenderers/slimVideoDescriptionRenderer.vue";
|
import SlimVideoDescriptionRenderer from "~/components/UtilRenderers/slimVideoDescriptionRenderer.vue";
|
||||||
|
|
||||||
import backType from "~/plugins/classes/backType";
|
import backType from "~/plugins/classes/backType";
|
||||||
|
@ -296,11 +290,9 @@ import backType from "~/plugins/classes/backType";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
player,
|
player,
|
||||||
ShelfRenderer,
|
|
||||||
VidLoadRenderer,
|
VidLoadRenderer,
|
||||||
ItemSectionRenderer,
|
ItemSectionRenderer,
|
||||||
mainCommentRenderer,
|
mainCommentRenderer,
|
||||||
SwipeableBottomSheet,
|
|
||||||
SlimVideoDescriptionRenderer,
|
SlimVideoDescriptionRenderer,
|
||||||
},
|
},
|
||||||
layout: "empty",
|
layout: "empty",
|
||||||
|
@ -512,6 +504,22 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.comments {
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 2;
|
||||||
|
opacity: 0;
|
||||||
|
height: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
transform: translateY(100%);
|
||||||
|
transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
|
||||||
|
}
|
||||||
|
.comments-open {
|
||||||
|
transform: translatey(0);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
#watch-body {
|
#watch-body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
max-height: 100vh;
|
max-height: 100vh;
|
||||||
|
|
Loading…
Reference in a new issue