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