1
0
mirror of https://github.com/TeamPiped/Piped.git synced 2024-12-13 13:50:27 +05:30

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

View File

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

View File

@ -8,13 +8,13 @@ export default {
<template> <template>
<!-- For large screens --> <!-- 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"> <i18n-t keypath="player.watch_on" tag="strong">
<font-awesome-icon class="mx-1.5" :icon="['fab', 'youtube']" /> <font-awesome-icon class="mx-1.5" :icon="['fab', 'youtube']" />
</i18n-t> </i18n-t>
</a> </a>
<!-- For small screens --> <!-- 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']" /> <font-awesome-icon class="mx-1.5" :icon="['fab', 'youtube']" />
</a> </a>
</template> </template>

View File

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