Add a channel sharing panel

This commit is contained in:
root
2022-10-11 22:03:15 +05:30
parent 37648e9cb8
commit 4642a86cbb
3 changed files with 45 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
<template>
<v-dialog v-model="dialogOpen" width="720">
<template v-slot:activator="{ on, attrs }">
<v-btn outlined small v-bind="attrs" class="ml-2" v-on="on">
{{ $t('channel_sharing_panel.share') }}
</v-btn>
</template>
<v-card>
<v-card-title>
{{ $t('channel_sharing_panel.title') }}
</v-card-title>
<v-card-text>
<v-text-field readonly :value="value" />
</v-card-text>
</v-card>
</v-dialog>
</template>
<script>
export default {
name: 'ChannelSharingPanel',
props: ['channelId'],
data: () => ({
dialogOpen: false
}),
computed: {
value () {
const u = new URL(window.location.href)
for (const k of u.searchParams.keys()) {
u.searchParams.delete(k)
}
u.hash = ''
u.pathname = '/channel/' + this.channelId
return u.href
}
}
}
</script>
+3
View File
@@ -11,6 +11,7 @@
<span class="text-h5 ml-4">
{{ channel.name }}
<v-icon v-if="channel.verified">{{ mdiCheckCircleOutline }}</v-icon>
<ChannelSharingPanel :channel-id="channel.id" />
<br />
<span class="text-subtitle-1">
<ExpandableNumber :num="channel.subscriberCount" message-key="counts.subscribers" />
@@ -47,6 +48,7 @@ import VideoItem from '@/components/Video/VideoItem.vue'
import SubscriptionButton from '@/components/SubscriptionButton'
import GridRow from '@/components/Grid/GridRow'
import GridCol from '@/components/Grid/GridCol'
import ChannelSharingPanel from '@/components/ChannelSharingPanel'
import { LibPiped } from '@/tools/libpiped'
@@ -153,6 +155,7 @@ export default {
}
},
components: {
ChannelSharingPanel,
ExpandableNumber,
GridRow,
GridCol,
+4
View File
@@ -40,6 +40,10 @@
"music_playlists": "Playlists (YouTube Music)"
}
},
"channel_sharing_panel": {
"title": "Share this channel",
"share": "Share"
},
"video_sharing_panel": {
"title": "Share this video",
"share": "Share",