2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
2024-02-13 16:59:27 +01:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 07:31:52 +02:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-01-29 20:37:25 +01:00
|
|
|
<template>
|
2022-06-20 10:38:49 +02:00
|
|
|
<MkStickyContainer>
|
2022-06-22 09:29:21 +02:00
|
|
|
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
|
2024-01-18 10:21:33 +01:00
|
|
|
<MkHorizontalSwipe v-model:tab="tab" :tabs="headerTabs">
|
|
|
|
<div v-if="tab === 'featured'" key="featured">
|
2022-07-01 16:33:47 +02:00
|
|
|
<XFeatured/>
|
|
|
|
</div>
|
2024-01-18 10:21:33 +01:00
|
|
|
<div v-else-if="tab === 'users'" key="users">
|
2022-07-13 11:09:41 +02:00
|
|
|
<XUsers/>
|
2022-07-01 16:33:47 +02:00
|
|
|
</div>
|
2024-01-18 10:21:33 +01:00
|
|
|
<div v-else-if="tab === 'roles'" key="roles">
|
2023-02-22 06:43:18 +01:00
|
|
|
<XRoles/>
|
|
|
|
</div>
|
2024-01-18 10:21:33 +01:00
|
|
|
</MkHorizontalSwipe>
|
2022-06-20 10:38:49 +02:00
|
|
|
</MkStickyContainer>
|
2020-01-29 20:37:25 +01:00
|
|
|
</template>
|
|
|
|
|
2022-06-20 10:38:49 +02:00
|
|
|
<script lang="ts" setup>
|
2023-12-07 06:42:09 +01:00
|
|
|
import { computed, watch, ref, shallowRef } from 'vue';
|
2022-07-01 16:33:47 +02:00
|
|
|
import XFeatured from './explore.featured.vue';
|
|
|
|
import XUsers from './explore.users.vue';
|
2023-02-22 06:43:18 +01:00
|
|
|
import XRoles from './explore.roles.vue';
|
2023-01-09 01:41:25 +01:00
|
|
|
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
2024-01-18 10:21:33 +01:00
|
|
|
import MkHorizontalSwipe from '@/components/MkHorizontalSwipe.vue';
|
2023-09-19 09:37:43 +02:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
2022-06-20 10:38:49 +02:00
|
|
|
|
2023-01-02 05:19:32 +01:00
|
|
|
const props = withDefaults(defineProps<{
|
2022-06-20 10:38:49 +02:00
|
|
|
tag?: string;
|
2023-01-02 05:19:32 +01:00
|
|
|
initialTab?: string;
|
|
|
|
}>(), {
|
|
|
|
initialTab: 'featured',
|
|
|
|
});
|
2022-06-20 10:38:49 +02:00
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const tab = ref(props.initialTab);
|
|
|
|
const tagsEl = shallowRef<InstanceType<typeof MkFoldableSection>>();
|
2022-06-20 10:38:49 +02:00
|
|
|
|
|
|
|
watch(() => props.tag, () => {
|
2023-12-07 06:42:09 +01:00
|
|
|
if (tagsEl.value) tagsEl.value.toggleContent(props.tag == null);
|
2022-06-20 10:38:49 +02:00
|
|
|
});
|
2020-01-29 20:37:25 +01:00
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const headerActions = computed(() => []);
|
2022-06-20 10:38:49 +02:00
|
|
|
|
2023-12-07 06:42:09 +01:00
|
|
|
const headerTabs = computed(() => [{
|
2022-07-01 16:33:47 +02:00
|
|
|
key: 'featured',
|
2023-11-03 23:20:53 +01:00
|
|
|
icon: 'ph-lightning ph-bold ph-lg',
|
2022-07-01 16:33:47 +02:00
|
|
|
title: i18n.ts.featured,
|
2022-06-20 10:38:49 +02:00
|
|
|
}, {
|
2022-07-13 11:09:41 +02:00
|
|
|
key: 'users',
|
2023-11-03 23:20:53 +01:00
|
|
|
icon: 'ph-users ph-bold ph-lg',
|
2022-07-01 16:33:47 +02:00
|
|
|
title: i18n.ts.users,
|
2023-02-22 06:43:18 +01:00
|
|
|
}, {
|
|
|
|
key: 'roles',
|
2023-11-03 23:20:53 +01:00
|
|
|
icon: 'ph-seal-check ph-bold ph-lg',
|
2023-02-22 06:43:18 +01:00
|
|
|
title: i18n.ts.roles,
|
2022-06-20 10:38:49 +02:00
|
|
|
}]);
|
|
|
|
|
2024-02-16 08:17:09 +01:00
|
|
|
definePageMetadata(() => ({
|
2022-06-20 10:38:49 +02:00
|
|
|
title: i18n.ts.explore,
|
2023-09-30 21:53:52 +02:00
|
|
|
icon: 'ph-hash ph-bold ph-lg',
|
2024-02-16 08:17:09 +01:00
|
|
|
}));
|
2020-01-29 20:37:25 +01:00
|
|
|
</script>
|