0
0

fix(frontend-embed): fix instanceticker, remove directives (#14631)

This commit is contained in:
かっこかり 2024-09-25 16:28:32 +09:00 committed by GitHub
parent 8c3be57ab3
commit 0f8b15f0fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 5 deletions

View File

@ -29,12 +29,12 @@ const props = defineProps<{
// if no instance data is given, this is for the local instance // if no instance data is given, this is for the local instance
const instance = props.instance ?? { const instance = props.instance ?? {
name: serverMetadata.name, name: serverMetadata.name,
themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement).content, themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement)?.content,
}; };
const faviconUrl = computed(() => props.instance ? mediaProxy.getProxiedImageUrlNullable(props.instance.faviconUrl, 'preview') : mediaProxy.getProxiedImageUrlNullable(serverMetadata.iconUrl, 'preview') ?? '/favicon.ico'); const faviconUrl = computed(() => props.instance ? mediaProxy.getProxiedImageUrlNullable(props.instance.faviconUrl, 'preview') : mediaProxy.getProxiedImageUrlNullable(serverMetadata.iconUrl, 'preview') ?? '/favicon.ico');
const themeColor = serverMetadata.themeColor ?? '#777777'; const themeColor = props.instance?.themeColor ?? serverMetadata.themeColor ?? '#777777';
const bg = { const bg = {
background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)`, background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)`,

View File

@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
--> -->
<template> <template>
<MkA v-user-preview="canonical" :class="[$style.root]" :to="url" :style="{ background: bgCss }"> <MkA :class="[$style.root]" :to="url" :style="{ background: bgCss }">
<span> <span>
<span>@{{ username }}</span> <span>@{{ username }}</span>
<span v-if="(host != localHost)" :class="$style.host">@{{ toUnicode(host) }}</span> <span v-if="(host != localHost)" :class="$style.host">@{{ toUnicode(host) }}</span>

View File

@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<i class="ti ti-repeat" style="margin-right: 4px;"></i> <i class="ti ti-repeat" style="margin-right: 4px;"></i>
<I18n :src="i18n.ts.renotedBy" tag="span" :class="$style.renoteText"> <I18n :src="i18n.ts.renotedBy" tag="span" :class="$style.renoteText">
<template #user> <template #user>
<EmA v-user-preview="true ? undefined : note.userId" :class="$style.renoteUserName" :to="userPage(note.user)"> <EmA :class="$style.renoteUserName" :to="userPage(note.user)">
<EmUserName :user="note.user"/> <EmUserName :user="note.user"/>
</EmA> </EmA>
</template> </template>
@ -44,6 +44,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<EmAvatar :class="$style.avatar" :user="appearNote.user" link/> <EmAvatar :class="$style.avatar" :user="appearNote.user" link/>
<div :class="$style.main"> <div :class="$style.main">
<EmNoteHeader :note="appearNote" :mini="true"/> <EmNoteHeader :note="appearNote" :mini="true"/>
<EmInstanceTicker v-if="appearNote.user.instance != null" :instance="appearNote.user.instance"/>
<div style="container-type: inline-size;"> <div style="container-type: inline-size;">
<p v-if="appearNote.cw != null" :class="$style.cw"> <p v-if="appearNote.cw != null" :class="$style.cw">
<EmMfm v-if="appearNote.cw != ''" style="margin-right: 8px;" :text="appearNote.cw" :author="appearNote.user" :nyaize="'respect'"/> <EmMfm v-if="appearNote.cw != ''" style="margin-right: 8px;" :text="appearNote.cw" :author="appearNote.user" :nyaize="'respect'"/>
@ -111,6 +112,7 @@ import I18n from '@/components/I18n.vue';
import EmNoteSub from '@/components/EmNoteSub.vue'; import EmNoteSub from '@/components/EmNoteSub.vue';
import EmNoteHeader from '@/components/EmNoteHeader.vue'; import EmNoteHeader from '@/components/EmNoteHeader.vue';
import EmNoteSimple from '@/components/EmNoteSimple.vue'; import EmNoteSimple from '@/components/EmNoteSimple.vue';
import EmInstanceTicker from '@/components/EmInstanceTicker.vue';
import EmReactionsViewer from '@/components/EmReactionsViewer.vue'; import EmReactionsViewer from '@/components/EmReactionsViewer.vue';
import EmMediaList from '@/components/EmMediaList.vue'; import EmMediaList from '@/components/EmMediaList.vue';
import EmPoll from '@/components/EmPoll.vue'; import EmPoll from '@/components/EmPoll.vue';

View File

@ -54,6 +54,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</a> </a>
</div> </div>
</div> </div>
<EmInstanceTicker v-if="appearNote.user.instance != null" :instance="appearNote.user.instance"/>
</div> </div>
</header> </header>
<div :class="[$style.noteContent, { [$style.contentCollapsed]: collapsed }]"> <div :class="[$style.noteContent, { [$style.contentCollapsed]: collapsed }]">
@ -132,6 +133,7 @@ import I18n from '@/components/I18n.vue';
import EmMediaList from '@/components/EmMediaList.vue'; import EmMediaList from '@/components/EmMediaList.vue';
import EmNoteSub from '@/components/EmNoteSub.vue'; import EmNoteSub from '@/components/EmNoteSub.vue';
import EmNoteSimple from '@/components/EmNoteSimple.vue'; import EmNoteSimple from '@/components/EmNoteSimple.vue';
import EmInstanceTicker from '@/components/EmInstanceTicker.vue';
import EmReactionsViewer from '@/components/EmReactionsViewer.vue'; import EmReactionsViewer from '@/components/EmReactionsViewer.vue';
import EmPoll from '@/components/EmPoll.vue'; import EmPoll from '@/components/EmPoll.vue';
import EmA from '@/components/EmA.vue'; import EmA from '@/components/EmA.vue';

View File

@ -11,7 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div v-if="note.user.isBot" :class="$style.isBot">bot</div> <div v-if="note.user.isBot" :class="$style.isBot">bot</div>
<div :class="$style.username"><EmAcct :user="note.user"/></div> <div :class="$style.username"><EmAcct :user="note.user"/></div>
<div v-if="note.user.badgeRoles" :class="$style.badgeRoles"> <div v-if="note.user.badgeRoles" :class="$style.badgeRoles">
<img v-for="(role, i) in note.user.badgeRoles" :key="i" v-tooltip="role.name" :class="$style.badgeRole" :src="role.iconUrl!"/> <img v-for="(role, i) in note.user.badgeRoles" :key="i" :class="$style.badgeRole" :src="role.iconUrl!"/>
</div> </div>
<div :class="$style.info"> <div :class="$style.info">
<EmA :to="notePage(note)"> <EmA :to="notePage(note)">