2020-08-18 06:44:21 -07:00
|
|
|
<template>
|
2021-12-22 23:10:13 -08: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 06:44:21 -07:00
|
|
|
</div>
|
2021-12-22 23:10:13 -08: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 06:44:21 -07:00
|
|
|
</div>
|
2021-12-22 23:10:13 -08: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 06:44:21 -07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-12-22 23:10:13 -08:00
|
|
|
import { computed, defineComponent } from 'vue';
|
2021-11-11 09:02:25 -08: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 06:44:21 -07:00
|
|
|
|
2020-10-17 04:12:00 -07:00
|
|
|
export default defineComponent({
|
2020-08-18 06:44:21 -07:00
|
|
|
components: {
|
2021-12-22 23:10:13 -08:00
|
|
|
MkChannelPreview, MkPagination, MkButton,
|
2020-08-18 06:44:21 -07:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-12-22 23:10:13 -08:00
|
|
|
[symbols.PAGE_INFO]: computed(() => ({
|
2020-12-25 17:47:36 -08:00
|
|
|
title: this.$ts.channel,
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-satellite-dish',
|
2021-12-22 23:10:13 -08:00
|
|
|
bg: 'var(--bg)',
|
|
|
|
actions: [{
|
2021-04-20 07:22:59 -07:00
|
|
|
icon: 'fas fa-plus',
|
2021-12-22 23:10:13 -08:00
|
|
|
text: this.$ts.create,
|
2021-12-23 00:05:26 -08:00
|
|
|
handler: this.create,
|
2021-12-22 23:10:13 -08: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 06:44:21 -07:00
|
|
|
tab: 'featured',
|
|
|
|
featuredPagination: {
|
2022-01-12 09:26:10 -08:00
|
|
|
endpoint: 'channels/featured' as const,
|
2020-08-30 02:18:34 -07:00
|
|
|
noPaging: true,
|
2020-08-18 06:44:21 -07:00
|
|
|
},
|
|
|
|
followingPagination: {
|
2022-01-12 09:26:10 -08:00
|
|
|
endpoint: 'channels/followed' as const,
|
2020-08-18 06:44:21 -07:00
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
ownedPagination: {
|
2022-01-12 09:26:10 -08:00
|
|
|
endpoint: 'channels/owned' as const,
|
2020-08-18 06:44:21 -07:00
|
|
|
limit: 5,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
create() {
|
|
|
|
this.$router.push(`/channels/new`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|