Move conditional rendering logic to WatchOnYouTubeButton

This commit is contained in:
thecashewtrader 2022-11-03 14:44:08 +05:30 committed by Kavin
parent 662eb32e3e
commit b382b525b1
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
4 changed files with 5 additions and 14 deletions

View File

@ -35,10 +35,7 @@
<font-awesome-icon icon="rss" />
</a>
<WatchOnYouTubeButton
v-if="this.getPreferenceBoolean('showWatchOnYouTube', false)"
:link="`https://youtube.com/channel/${this.channel.id}`"
/>
<WatchOnYouTubeButton :link="`https://youtube.com/channel/${this.channel.id}`" />
<div class="flex mt-4 mb-2">
<button

View File

@ -23,10 +23,7 @@
<a class="btn mr-1" :href="getRssUrl">
<font-awesome-icon icon="rss" />
</a>
<WatchOnYouTubeButton
v-if="this.getPreferenceBoolean('showWatchOnYouTube', false)"
:link="`https://www.youtube.com/playlist?list=${this.$route.query.list}`"
/>
<WatchOnYouTubeButton :link="`https://www.youtube.com/playlist?list=${this.$route.query.list}`" />
</div>
</div>

View File

@ -8,13 +8,13 @@ export default {
<template>
<!-- For large screens -->
<a :href="link" class="btn lt-lg:hidden">
<a :href="link" v-if="this.getPreferenceBoolean('showWatchOnYouTube', false)" class="btn lt-lg:hidden">
<i18n-t keypath="player.watch_on" tag="strong">
<font-awesome-icon class="mx-1.5" :icon="['fab', 'youtube']" />
</i18n-t>
</a>
<!-- For small screens -->
<a :href="link" class="btn lg:hidden">
<a :href="link" v-if="this.getPreferenceBoolean('showWatchOnYouTube', false)" class="btn lg:hidden">
<font-awesome-icon class="mx-1.5" :icon="['fab', 'youtube']" />
</a>
</template>

View File

@ -108,10 +108,7 @@
>
<font-awesome-icon icon="rss" />
</a>
<WatchOnYouTubeButton
v-if="this.getPreferenceBoolean('showWatchOnYouTube', false)"
:link="`https://youtu.be/${getVideoId()}`"
/>
<WatchOnYouTubeButton :link="`https://youtu.be/${getVideoId()}`" />
<!-- Share Dialog -->
<button class="btn" @click="showShareModal = !showShareModal">
<i18n-t class="lt-lg:hidden" keypath="actions.share" tag="strong"></i18n-t>