もっと!ボタンでリアクション一覧が開けるように

This commit is contained in:
1Step621 2024-01-07 13:27:43 +09:00
parent 9eae82de1d
commit ebf81dd87e
4 changed files with 19 additions and 11 deletions

View File

@ -93,9 +93,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<MkA v-if="appearNote.channel && !inChannel" :class="$style.channel" :to="`/channels/${appearNote.channel.id}`"><i class="ti ti-device-tv"></i> {{ appearNote.channel.name }}</MkA>
</div>
<MkReactionsViewer :note="appearNote" :maxNumber="16" @mockUpdateMyReaction="emitUpdReaction">
<MkReactionsViewer :note="appearNote" :maxNumber="1" @mockUpdateMyReaction="emitUpdReaction">
<template #more>
<div :class="$style.reactionOmitted">{{ i18n.ts.more }}</div>
<MkButton class="_button" link :to="`/notes/${appearNote.id}/reactions`" :class="$style.reactionOmitted">{{ i18n.ts.more }}</MkButton>
</template>
</MkReactionsViewer>
<footer :class="$style.footer">
@ -161,6 +161,7 @@ import MkReactionsViewer from '@/components/MkReactionsViewer.vue';
import MkMediaList from '@/components/MkMediaList.vue';
import MkCwButton from '@/components/MkCwButton.vue';
import MkPoll from '@/components/MkPoll.vue';
import MkButton from './MkButton.vue';
import MkUsersTooltip from '@/components/MkUsersTooltip.vue';
import MkUrlPreview from '@/components/MkUrlPreview.vue';
import MkInstanceTicker from '@/components/MkInstanceTicker.vue';
@ -961,10 +962,13 @@ function emitUpdReaction(emoji: string, delta: number) {
}
.reactionOmitted {
display: inline-block;
display: inline-flex;
align-items: center;
justify-content: center;
height: 32px;
margin: 2px;
padding: 0 6px;
opacity: .8;
margin: auto 2px;
border-radius: 6px;
padding: 0 3px;
border: dashed 1px var(--divider);
}
</style>

View File

@ -229,9 +229,12 @@ import MkPagination from '@/components/MkPagination.vue';
import MkReactionIcon from '@/components/MkReactionIcon.vue';
import MkButton from '@/components/MkButton.vue';
const props = defineProps<{
const props = withDefaults(defineProps<{
note: Misskey.entities.Note;
}>();
initialTab: string;
}>(), {
initialTab: 'replies',
});
const inChannel = inject('inChannel', null);
@ -299,7 +302,7 @@ provide('react', (reaction: string) => {
});
});
const tab = ref('replies');
const tab = ref(props.initialTab);
const reactionTabType = ref<string | null>(null);
const renotesPagination = computed(() => ({

View File

@ -18,7 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkButton v-if="!showNext" :class="$style.loadNext" @click="showNext = true"><i class="ti ti-chevron-up"></i></MkButton>
<div class="_margin _gaps_s">
<MkRemoteCaution v-if="note.user.host != null" :href="note.url ?? note.uri"/>
<MkNoteDetailed :key="note.id" v-model:note="note" :class="$style.note"/>
<MkNoteDetailed :key="note.id" v-model:note="note" :initialTab="initialTab" :class="$style.note"/>
</div>
<div v-if="clips && clips.length > 0" class="_margin">
<div style="font-weight: bold; padding: 12px;">{{ i18n.ts.clip }}</div>
@ -59,6 +59,7 @@ import { defaultStore } from '@/store.js';
const props = defineProps<{
noteId: string;
initialTab?: string;
}>();
const note = ref<null | Misskey.entities.Note>();

View File

@ -33,7 +33,7 @@ export const routes = [{
component: page(() => import('./pages/user/index.vue')),
}, {
name: 'note',
path: '/notes/:noteId',
path: '/notes/:noteId/:initialTab?',
component: page(() => import('./pages/note.vue')),
}, {
name: 'list',