hippofish/packages/frontend/src/pages/about.vue
かっこかり 6dd6fcf88f
enhance(frontend): サーバー情報・お問い合わせページを改修 (#14198)
* improve(frontend): サーバー情報・お問い合わせページを改修 (#238)

* Revert "Revert "enhance(frontend): add contact page" (#208)" (This reverts commit 5a329a09c987b3249f97f9d53af67d1bffb09eea.)

* improve(frontend): サーバー情報・お問い合わせページを改修

(cherry picked from commit e72758d8cda3db009c5d1bf1f4141682931b91f8)

* fix

* Update Changelog

* tweak

* lint

* 既存の翻訳を使用するように

---------

Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com>
2024-07-14 14:49:50 +09:00

75 lines
2.1 KiB
Vue

<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<MkStickyContainer>
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
<MkHorizontalSwipe v-model:tab="tab" :tabs="headerTabs">
<MkSpacer v-if="tab === 'overview'" :contentMax="600" :marginMin="20">
<XOverview/>
</MkSpacer>
<MkSpacer v-else-if="tab === 'emojis'" :contentMax="1000" :marginMin="20">
<XEmojis/>
</MkSpacer>
<MkSpacer v-else-if="tab === 'federation'" :contentMax="1000" :marginMin="20">
<XFederation/>
</MkSpacer>
<MkSpacer v-else-if="tab === 'charts'" :contentMax="1000" :marginMin="20">
<MkInstanceStats/>
</MkSpacer>
</MkHorizontalSwipe>
</MkStickyContainer>
</template>
<script lang="ts" setup>
import { computed, defineAsyncComponent, ref, watch } from 'vue';
import { i18n } from '@/i18n.js';
import { claimAchievement } from '@/scripts/achievements.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import MkHorizontalSwipe from '@/components/MkHorizontalSwipe.vue';
const XOverview = defineAsyncComponent(() => import('@/pages/about.overview.vue'));
const XEmojis = defineAsyncComponent(() => import('@/pages/about.emojis.vue'));
const XFederation = defineAsyncComponent(() => import('@/pages/about.federation.vue'));
const MkInstanceStats = defineAsyncComponent(() => import('@/components/MkInstanceStats.vue'));
const props = withDefaults(defineProps<{
initialTab?: string;
}>(), {
initialTab: 'overview',
});
const tab = ref(props.initialTab);
watch(tab, () => {
if (tab.value === 'charts') {
claimAchievement('viewInstanceChart');
}
});
const headerActions = computed(() => []);
const headerTabs = computed(() => [{
key: 'overview',
title: i18n.ts.overview,
}, {
key: 'emojis',
title: i18n.ts.customEmojis,
icon: 'ti ti-icons',
}, {
key: 'federation',
title: i18n.ts.federation,
icon: 'ti ti-whirl',
}, {
key: 'charts',
title: i18n.ts.charts,
icon: 'ti ti-chart-line',
}]);
definePageMetadata(() => ({
title: i18n.ts.instanceInfo,
icon: 'ti ti-info-circle',
}));
</script>