forked from misskey-dev/misskey
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): リアクション一覧詳細ダイアログを表示できるように (for v12)
Co-authored-by: syuilo <[email protected]>
- Loading branch information
Showing
28 changed files
with
153 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
packages/client/src/components/MkReactedUsersDialog.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<template> | ||
<MkModalWindow | ||
ref="dialog" | ||
:width="400" | ||
:height="450" | ||
@close="dialog.close()" | ||
@closed="emit('closed')" | ||
> | ||
<template #header>{{ i18n.ts.reactions }}</template> | ||
|
||
<MkSpacer :margin-min="20" :margin-max="28"> | ||
<div v-if="note" class="mk-reacted-users-dialog _gaps"> | ||
<div v-if="reactions.length === 0" class="_fullinfo"> | ||
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/> | ||
<div>{{ i18n.ts.nothing }}</div> | ||
</div> | ||
<template v-else> | ||
<div class="tabs"> | ||
<button v-for="reaction in reactions" :key="reaction" class="tab _button" :class="{ tabActive: tab === reaction }" @click="tab = reaction"> | ||
<MkReactionIcon :reaction="reaction" :custom-emojis="note.emojis"/> | ||
<span style="margin-left: 4px;">{{ note.reactions[reaction] }}</span> | ||
</button> | ||
</div> | ||
<MkA v-for="user in users" :key="user.id" :to="userPage(user)"> | ||
<MkUserCardMini :user="user" :with-chart="false"/> | ||
</MkA> | ||
</template> | ||
</div> | ||
<div v-else> | ||
<MkLoading/> | ||
</div> | ||
</MkSpacer> | ||
</MkModalWindow> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { onMounted, watch } from 'vue'; | ||
import * as misskey from 'misskey-js'; | ||
import MkModalWindow from '@/components/MkModalWindow.vue'; | ||
import MkReactionIcon from '@/components/MkReactionIcon.vue'; | ||
import MkUserCardMini from '@/components/MkUserCardMini.vue'; | ||
import { userPage } from '@/filters/user'; | ||
import { i18n } from '@/i18n'; | ||
import * as os from '@/os'; | ||
const emit = defineEmits<{ | ||
(ev: 'closed'): void, | ||
}>(); | ||
const props = defineProps<{ | ||
noteId: misskey.entities.Note['id']; | ||
}>(); | ||
const dialog = $shallowRef<InstanceType<typeof MkModalWindow>>(); | ||
let note = $ref<misskey.entities.Note>(); | ||
let tab = $ref<string>(); | ||
let reactions = $ref<string[]>(); | ||
let users = $ref(); | ||
watch($$(tab), async () => { | ||
const res = await os.api('notes/reactions', { | ||
noteId: props.noteId, | ||
type: tab, | ||
limit: 30, | ||
}); | ||
users = res.map(x => x.user); | ||
}); | ||
onMounted(() => { | ||
os.api('notes/show', { | ||
noteId: props.noteId, | ||
}).then((res) => { | ||
reactions = Object.keys(res.reactions); | ||
tab = reactions[0]; | ||
note = res; | ||
}); | ||
}); | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.mk-reacted-users-dialog { | ||
.tabs { | ||
display: flex; | ||
gap: 8px; | ||
flex-wrap: wrap; | ||
.tab { | ||
padding: 4px 6px; | ||
border: solid 1px var(--divider); | ||
border-radius: 6px; | ||
&.tabActive { | ||
border-color: var(--accent); | ||
} | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters