diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2023-02-11 13:05:36 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-11 13:05:36 +0900 |
| commit | 6f33be6c75866bc40cdfc95beb8ba6e1714f1e42 (patch) | |
| tree | aaec1f1bf4dcfca131a5c38e6e2eab64c0b8abc3 /packages/frontend/src/components/MkNote.vue | |
| parent | enhance(client): URLが4つ以上添付されている場合折りたたむ... (diff) | |
| download | misskey-6f33be6c75866bc40cdfc95beb8ba6e1714f1e42.tar.gz misskey-6f33be6c75866bc40cdfc95beb8ba6e1714f1e42.tar.bz2 misskey-6f33be6c75866bc40cdfc95beb8ba6e1714f1e42.zip | |
enhance(client): MkNoteのリアクションの表示数は16に制限 (#9841)
* enhance(client): MkNoteのリアクションの表示数は16に制限・リアクションの横の?ボタンでリアクション詳細
* info-circleにする
* - Layout Shiftが起こらないように
- 自分のリアクションは必ずつける
* https://github.com/misskey-dev/misskey/pull/9841#issuecomment-1423786235
* remove logger
* refactor
* refactor
Co-authored-by: acid-chicken <root@acid-chicken.com>
* Revert "https://github.com/misskey-dev/misskey/pull/9841#issuecomment-1423786235"
This reverts commit ec1315b1fb207e0c5b2a5f2f4a00de7379c7a29b.
* wip
* wip
* :art:
* fix
* fix
* fix
* :art:
* wip
* remove extras from MkNoteDetailed
* もっと!
* no v-if
* dashed
---------
Co-authored-by: acid-chicken <root@acid-chicken.com>
Diffstat (limited to 'packages/frontend/src/components/MkNote.vue')
| -rw-r--r-- | packages/frontend/src/components/MkNote.vue | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index d830e0e47e..e910fbab01 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -5,7 +5,7 @@ ref="el" v-hotkey="keymap" :class="$style.root" - :tabindex="!isDeleted ? '-1' : null" + :tabindex="!isDeleted ? '-1' : undefined" > <MkNoteSub v-if="appearNote.reply && !renoteCollapsed" :note="appearNote.reply" :class="$style.replyTo"/> <div v-if="pinned" :class="$style.tip"><i class="ti ti-pin"></i> {{ i18n.ts.pinnedNote }}</div> @@ -77,7 +77,13 @@ <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> <footer :class="$style.footer"> - <MkReactionsViewer :note="appearNote"/> + <MkReactionsViewer :note="appearNote" :max-number="16"> + <template v-slot:more> + <button class="_button" :class="$style.reactionDetailsButton" @click="showReactions"> + {{ i18n.ts.more }} + </button> + </template> + </MkReactionsViewer> <button :class="$style.footerButton" class="_button" @click="reply()"> <i class="ti ti-arrow-back-up"></i> <p v-if="appearNote.repliesCount > 0" :class="$style.footerButtonCount">{{ appearNote.repliesCount }}</p> @@ -120,7 +126,7 @@ </template> <script lang="ts" setup> -import { computed, inject, onMounted, onUnmounted, reactive, ref, shallowRef, Ref } from 'vue'; +import { computed, inject, onMounted, onUnmounted, reactive, ref, shallowRef, Ref, defineAsyncComponent } from 'vue'; import * as mfm from 'mfm-js'; import * as misskey from 'misskey-js'; import MkNoteSub from '@/components/MkNoteSub.vue'; @@ -196,7 +202,7 @@ const isLong = (appearNote.cw == null && appearNote.text != null && ( const collapsed = ref(appearNote.cw == null && isLong); const isDeleted = ref(false); const muted = ref(checkWordMute(appearNote, $i, defaultStore.state.mutedWords)); -const translation = ref(null); +const translation = ref<any>(null); const translating = ref(false); const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.user.instance); const canRenote = computed(() => ['public', 'home'].includes(appearNote.visibility) || appearNote.userId === $i.id); @@ -361,6 +367,12 @@ function readPromo() { }); isDeleted.value = true; } + +function showReactions(): void { + os.popup(defineAsyncComponent(() => import('@/components/MkReactedUsersDialog.vue')), { + noteId: appearNote.id, + }, {}, 'closed'); +} </script> <style lang="scss" module> @@ -697,4 +709,19 @@ function readPromo() { text-align: center; opacity: 0.7; } + +.reactionDetailsButton { + display: inline-block; + height: 32px; + margin: 2px; + padding: 0 6px; + border: dashed 1px var(--divider); + border-radius: 4px; + background: transparent; + opacity: .8; + + &:hover { + background: var(--X5); + } +} </style> |