Put "Watch on Odysee" into a separate component

This commit is contained in:
Nyte 2023-06-15 15:55:47 +02:00
parent bea31f534b
commit b31516d1cb
2 changed files with 24 additions and 17 deletions

View file

@ -0,0 +1,21 @@
<script>
export default {
props: {
link: String,
},
};
</script>
<template>
<template v-if="this.getPreferenceBoolean('showWatchOnYouTube', false)">
<!-- For large screens -->
<a :href="link" class="btn lt-lg:hidden flex items-center">
<i18n-t keypath="player.watch_on" tag="strong">Odysee</i18n-t>
<font-awesome-icon class="mx-1.5" :icon="['fab', 'odysee']" />
</a>
<!-- For small screens -->
<a :href="link" class="btn lg:hidden flex items-center">
<font-awesome-icon class="mx-1.5" :icon="['fab', 'odysee']" />
</a>
</template>
</template>

View file

@ -121,23 +121,7 @@
<!-- YouTube -->
<WatchOnYouTubeButton :link="`https://youtu.be/${getVideoId()}`" />
<!-- Odysee -->
<!-- For large screens -->
<a
v-if="video.lbryId"
:href="'https://odysee.com/' + video.lbryId"
class="btn lt-lg:hidden flex items-center"
>
<i18n-t keypath="player.watch_on" tag="strong">Odysee</i18n-t>
<font-awesome-icon class="mx-1.5" :icon="['fab', 'odysee']" />
</a>
<!-- For small screens -->
<a
v-if="video.lbryId"
:href="'https://odysee.com/' + video.lbryId"
class="btn lg:hidden flex items-center"
>
<font-awesome-icon class="mx-1.5" :icon="['fab', 'odysee']" />
</a>
<WatchOnOdyseeButton :link="`https://odysee.com/${video.lbryId}`" />
<!-- listen / watch toggle -->
<router-link
:to="toggleListenUrl"
@ -251,6 +235,7 @@ import WatchOnYouTubeButton from "./WatchOnYouTubeButton.vue";
import LoadingIndicatorPage from "./LoadingIndicatorPage.vue";
import ToastComponent from "./ToastComponent.vue";
import { parseTimeParam } from "@/utils/Misc";
import WatchOnOdyseeButton from "./WatchOnOdyseeButton.vue";
export default {
name: "App",
@ -264,6 +249,7 @@ export default {
ShareModal,
PlaylistVideos,
WatchOnYouTubeButton,
WatchOnOdyseeButton,
LoadingIndicatorPage,
ToastComponent,
},