enhance(credits): use instance meta instead of hard code

This commit is contained in:
オスカー、 2024-11-27 17:44:23 +09:00
parent 00729a9b8e
commit 06f160a2b4
No known key found for this signature in database
GPG key ID: 139D6573F92DA9F7
19 changed files with 219 additions and 11 deletions

View file

@ -133,15 +133,15 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #label>{{ i18n.ts.credits }}</template>
<div :class="$style.contributors">
<MkA v-for="user in staffs" :to="`/@${user.username}`" :class="$style.contributor">
<img :src="user.avatarUrl ?? '/static-assets/avatar.png'" :class="$style.contributorAvatar" :alt="`Profile image of @${user.username}@oscar.surf`">
<MkAvatar :user="user" :class="$style.contributorAvatar" :alt="`Profile image of @${user.username}@oscar.surf`"/>
<span :class="$style.contributorUsername">@{{ user.username }}
<span :class="$style.contributorClient">
<span :class="$style.oscar">オスカー</span>
<span :class="instanceColor">{{ instance.name }}</span>
</span>
</span>
</MkA>
<MkA v-if="$i !== null" :to="`/@${$i.username}`" :class="$style.contributor">
<img :src="$i.avatarUrl ?? '/static-assets/avatar.png'" :class="$style.contributorAvatar" :alt="`Profile image of @${$i.username}@oscar.surf`">
<MkAvatar :user="$i" :class="$style.contributorAvatar" :alt="`Profile image of @${$i.username}@oscar.surf`"/>
<span :class="$style.contributorUsername">{{ `@${$i.username}` }}
<span :class="$style.contributorClient">
<span :class="$style.thankYou">{{ i18n.ts.thankYou }}</span>
@ -191,6 +191,7 @@ import FormSection from '@/components/form/section.vue';
import FormSuspense from '@/components/form/suspense.vue';
import FormSplit from '@/components/form/split.vue';
import MkA from '@/components/global/MkA.vue';
import MkAvatar from '@/components/global/MkAvatar.vue';
import MkFolder from '@/components/MkFolder.vue';
import MkKeyValue from '@/components/MkKeyValue.vue';
import MkInfo from '@/components/MkInfo.vue';
@ -214,9 +215,13 @@ const props = withDefaults(defineProps<{
const stats = ref<Misskey.entities.StatsResponse | null>(null);
const tab = ref(props.initialTab);
const staffs = ref<Misskey.entities.User[]>([]);
const staffIds = ['9ua5ndrtx7', '9urvwtlwo6'];
const instanceColor = computed(() => {
return {
color: `${instance.themeColor}`,
};
});
staffs.value = await misskeyApi('users/show', { userIds: staffIds });
staffs.value = await misskeyApi('users/credits', {});
watch(tab, () => {
if (tab.value === 'charts') {
@ -361,10 +366,6 @@ definePageMetadata(() => ({
font-size: 11px;
font-weight: bold;
> .oscar {
color: #00ff63;
}
> .thankYou {
color: #5a70ff;
}