1
0
mirror of https://github.com/TeamPiped/Piped.git synced 2024-12-16 23:30:27 +05:30
Piped/src/components/TrendingPage.vue
Kavin 1c03633c62
Remove all non-essential js related to uikit. (#585)
* Remove all non-essential js related to uikit.

* Add padding to the bottom of the grid.
2021-10-31 17:44:36 +00:00

51 lines
1.2 KiB
Vue

<template>
<h1 v-t="'titles.trending'" class="uk-text-bold uk-text-center" />
<hr />
<div class="uk-grid uk-grid-xl">
<div
v-for="video in videos"
:key="video.url"
:style="[{ background: backgroundColor }]"
class="uk-width-1-2 uk-width-1-3@s uk-width-1-4@m uk-width-1-5@l uk-width-1-6@xl"
>
<VideoItem :video="video" height="118" width="210" />
</div>
</div>
</template>
<script>
import VideoItem from "@/components/VideoItem.vue";
export default {
components: {
VideoItem,
},
data() {
return {
videos: [],
};
},
mounted() {
let region = this.getPreferenceString("region", "US");
this.fetchTrending(region).then(videos => {
this.videos = videos;
this.updateWatched(this.videos);
});
},
activated() {
document.title = this.$t("titles.trending") + " - Piped";
if (this.videos.length > 0) this.updateWatched(this.videos);
},
methods: {
async fetchTrending(region) {
return await this.fetchJson(this.apiUrl() + "/trending", {
region: region || "US",
});
},
},
};
</script>