2020-08-18 15:44:21 +02:00
|
|
|
<template>
|
2021-12-23 08:10:13 +01:00
|
|
|
<MkSpacer :content-max="700">
|
|
|
|
<div v-if="tab === 'featured'" class="_content grwlizim featured">
|
|
|
|
<MkPagination v-slot="{items}" :pagination="featuredPagination">
|
|
|
|
<MkChannelPreview v-for="channel in items" :key="channel.id" class="_gap" :channel="channel"/>
|
|
|
|
</MkPagination>
|
2020-08-18 15:44:21 +02:00
|
|
|
</div>
|
2021-12-23 08:10:13 +01:00
|
|
|
<div v-else-if="tab === 'following'" class="_content grwlizim following">
|
|
|
|
<MkPagination v-slot="{items}" :pagination="followingPagination">
|
|
|
|
<MkChannelPreview v-for="channel in items" :key="channel.id" class="_gap" :channel="channel"/>
|
|
|
|
</MkPagination>
|
2020-08-18 15:44:21 +02:00
|
|
|
</div>
|
2021-12-23 08:10:13 +01:00
|
|
|
<div v-else-if="tab === 'owned'" class="_content grwlizim owned">
|
|
|
|
<MkButton class="new" @click="create()"><i class="fas fa-plus"></i></MkButton>
|
|
|
|
<MkPagination v-slot="{items}" :pagination="ownedPagination">
|
|
|
|
<MkChannelPreview v-for="channel in items" :key="channel.id" class="_gap" :channel="channel"/>
|
|
|
|
</MkPagination>
|
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
2020-08-18 15:44:21 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-12-23 08:10:13 +01:00
|
|
|
import { computed, defineComponent } from 'vue';
|
2021-11-11 18:02:25 +01:00
|
|
|
import MkChannelPreview from '@/components/channel-preview.vue';
|
|
|
|
import MkPagination from '@/components/ui/pagination.vue';
|
|
|
|
import MkButton from '@/components/ui/button.vue';
|
|
|
|
import * as symbols from '@/symbols';
|
2020-08-18 15:44:21 +02:00
|
|
|
|
2020-10-17 13:12:00 +02:00
|
|
|
export default defineComponent({
|
2020-08-18 15:44:21 +02:00
|
|
|
components: {
|
2021-12-23 08:10:13 +01:00
|
|
|
MkChannelPreview, MkPagination, MkButton,
|
2020-08-18 15:44:21 +02:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-12-23 08:10:13 +01:00
|
|
|
[symbols.PAGE_INFO]: computed(() => ({
|
2020-12-26 02:47:36 +01:00
|
|
|
title: this.$ts.channel,
|
2021-04-20 16:22:59 +02:00
|
|
|
icon: 'fas fa-satellite-dish',
|
2021-12-23 08:10:13 +01:00
|
|
|
bg: 'var(--bg)',
|
|
|
|
actions: [{
|
2021-04-20 16:22:59 +02:00
|
|
|
icon: 'fas fa-plus',
|
2021-12-23 08:10:13 +01:00
|
|
|
text: this.$ts.create,
|
2021-12-23 09:05:26 +01:00
|
|
|
handler: this.create,
|
2021-12-23 08:10:13 +01:00
|
|
|
}],
|
|
|
|
tabs: [{
|
|
|
|
active: this.tab === 'featured',
|
|
|
|
title: this.$ts._channel.featured,
|
|
|
|
icon: 'fas fa-fire-alt',
|
|
|
|
onClick: () => { this.tab = 'featured'; },
|
|
|
|
}, {
|
|
|
|
active: this.tab === 'following',
|
|
|
|
title: this.$ts._channel.following,
|
|
|
|
icon: 'fas fa-heart',
|
|
|
|
onClick: () => { this.tab = 'following'; },
|
|
|
|
}, {
|
|
|
|
active: this.tab === 'owned',
|
|
|
|
title: this.$ts._channel.owned,
|
|
|
|
icon: 'fas fa-edit',
|
|
|
|
onClick: () => { this.tab = 'owned'; },
|
|
|
|
},]
|
|
|
|
})),
|
2020-08-18 15:44:21 +02:00
|
|
|
tab: 'featured',
|
|
|
|
featuredPagination: {
|
|
|
|
endpoint: 'channels/featured',
|
2020-08-30 11:18:34 +02:00
|
|
|
noPaging: true,
|
2020-08-18 15:44:21 +02:00
|
|
|
},
|
|
|
|
followingPagination: {
|
|
|
|
endpoint: 'channels/followed',
|
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
ownedPagination: {
|
|
|
|
endpoint: 'channels/owned',
|
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
create() {
|
|
|
|
this.$router.push(`/channels/new`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|