summaryrefslogtreecommitdiff
path: root/packages/frontend/src/pages/channels.vue
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-12-27 14:36:33 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2022-12-27 14:36:33 +0900
commit9384f5399da39e53855beb8e7f8ded1aa56bf72e (patch)
treece5959571a981b9c4047da3c7b3fd080aa44222c /packages/frontend/src/pages/channels.vue
parentwip: retention for dashboard (diff)
downloadmisskey-9384f5399da39e53855beb8e7f8ded1aa56bf72e.tar.gz
misskey-9384f5399da39e53855beb8e7f8ded1aa56bf72e.tar.bz2
misskey-9384f5399da39e53855beb8e7f8ded1aa56bf72e.zip
rename: client -> frontend
Diffstat (limited to 'packages/frontend/src/pages/channels.vue')
-rw-r--r--packages/frontend/src/pages/channels.vue79
1 files changed, 79 insertions, 0 deletions
diff --git a/packages/frontend/src/pages/channels.vue b/packages/frontend/src/pages/channels.vue
new file mode 100644
index 0000000000..34e9dac196
--- /dev/null
+++ b/packages/frontend/src/pages/channels.vue
@@ -0,0 +1,79 @@
+<template>
+<MkStickyContainer>
+ <template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
+ <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>
+ </div>
+ <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>
+ </div>
+ <div v-else-if="tab === 'owned'" class="_content grwlizim owned">
+ <MkButton class="new" @click="create()"><i class="ti ti-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>
+</MkStickyContainer>
+</template>
+
+<script lang="ts" setup>
+import { computed, defineComponent, inject } from 'vue';
+import MkChannelPreview from '@/components/MkChannelPreview.vue';
+import MkPagination from '@/components/MkPagination.vue';
+import MkButton from '@/components/MkButton.vue';
+import { useRouter } from '@/router';
+import { definePageMetadata } from '@/scripts/page-metadata';
+import { i18n } from '@/i18n';
+
+const router = useRouter();
+
+let tab = $ref('featured');
+
+const featuredPagination = {
+ endpoint: 'channels/featured' as const,
+ noPaging: true,
+};
+const followingPagination = {
+ endpoint: 'channels/followed' as const,
+ limit: 5,
+};
+const ownedPagination = {
+ endpoint: 'channels/owned' as const,
+ limit: 5,
+};
+
+function create() {
+ router.push('/channels/new');
+}
+
+const headerActions = $computed(() => [{
+ icon: 'ti ti-plus',
+ text: i18n.ts.create,
+ handler: create,
+}]);
+
+const headerTabs = $computed(() => [{
+ key: 'featured',
+ title: i18n.ts._channel.featured,
+ icon: 'ti ti-comet',
+}, {
+ key: 'following',
+ title: i18n.ts._channel.following,
+ icon: 'ti ti-heart',
+}, {
+ key: 'owned',
+ title: i18n.ts._channel.owned,
+ icon: 'ti ti-edit',
+}]);
+
+definePageMetadata(computed(() => ({
+ title: i18n.ts.channel,
+ icon: 'ti ti-device-tv',
+})));
+</script>