summaryrefslogtreecommitdiff
path: root/src/client/components
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2020-07-27 13:34:20 +0900
committerGitHub <noreply@github.com>2020-07-27 13:34:20 +0900
commitcf43dd6ec530ba4a3f589ae917e89533b352f6a3 (patch)
tree76f35d06299b40370ec061ee5ed58182847d2e6e /src/client/components
parentrefactor(client): Do not mutate prop directly (diff)
downloadmisskey-cf43dd6ec530ba4a3f589ae917e89533b352f6a3.tar.gz
misskey-cf43dd6ec530ba4a3f589ae917e89533b352f6a3.tar.bz2
misskey-cf43dd6ec530ba4a3f589ae917e89533b352f6a3.zip
ワードミュート (#6594)
* wip * wip * wip * wip * wip * wip * wip * wip * wip
Diffstat (limited to 'src/client/components')
-rw-r--r--src/client/components/note.vue27
-rw-r--r--src/client/components/tab.vue42
2 files changed, 64 insertions, 5 deletions
diff --git a/src/client/components/note.vue b/src/client/components/note.vue
index dc3cce9e57..9bbf763494 100644
--- a/src/client/components/note.vue
+++ b/src/client/components/note.vue
@@ -1,6 +1,7 @@
<template>
<div
class="note _panel"
+ v-if="!muted"
v-show="!isDeleted"
:tabindex="!isDeleted ? '-1' : null"
:class="{ renote: isRenote }"
@@ -84,6 +85,13 @@
</article>
<x-sub v-for="note in replies" :key="note.id" :note="note" class="reply" :detail="true"/>
</div>
+<div v-else class="_panel muted" @click="muted = false">
+ <i18n path="userSaysSomething" tag="small">
+ <router-link class="name" :to="appearNote.user | userPage" v-user-preview="appearNote.userId" place="name">
+ <mk-user-name :user="appearNote.user"/>
+ </router-link>
+ </i18n>
+</div>
</template>
<script lang="ts">
@@ -105,6 +113,7 @@ import pleaseLogin from '../scripts/please-login';
import { focusPrev, focusNext } from '../scripts/focus';
import { url } from '../config';
import copyToClipboard from '../scripts/copy-to-clipboard';
+import { checkWordMute } from '../scripts/check-word-mute';
export default Vue.extend({
components: {
@@ -142,6 +151,7 @@ export default Vue.extend({
replies: [],
showContent: false,
isDeleted: false,
+ muted: false,
myReaction: null,
reactions: {},
emojis: [],
@@ -227,15 +237,16 @@ export default Vue.extend({
}
},
- created() {
- this.emojis = [...this.appearNote.emojis];
- this.reactions = { ...this.appearNote.reactions };
- this.myReaction = this.appearNote.myReaction;
-
+ async created() {
if (this.$store.getters.isSignedIn) {
this.connection = this.$root.stream;
}
+ this.emojis = [...this.appearNote.emojis];
+ this.reactions = { ...this.appearNote.reactions };
+ this.myReaction = this.appearNote.myReaction;
+ this.muted = await checkWordMute(this.appearNote, this.$store.state.i, this.$store.state.settings.mutedWords);
+
if (this.detail) {
this.$root.api('notes/children', {
noteId: this.appearNote.id,
@@ -976,4 +987,10 @@ export default Vue.extend({
}
}
}
+
+.muted {
+ padding: 8px;
+ text-align: center;
+ opacity: 0.7;
+}
</style>
diff --git a/src/client/components/tab.vue b/src/client/components/tab.vue
new file mode 100644
index 0000000000..3ea63fa59f
--- /dev/null
+++ b/src/client/components/tab.vue
@@ -0,0 +1,42 @@
+<template>
+<div class="pxhvhrfw" v-size="[{ max: 500 }]">
+ <button v-for="item in items" class="_button" @click="$emit('input', item.value)" :class="{ active: value === item.value }" :key="item.value">{{ item.label }}</button>
+</div>
+</template>
+
+<script lang="ts">
+import Vue from 'vue';
+
+export default Vue.extend({
+ props: {
+ items: {
+ type: Array,
+ required: true,
+ },
+ value: {
+ required: true,
+ },
+ },
+});
+</script>
+
+<style lang="scss" scoped>
+.pxhvhrfw {
+ display: flex;
+
+ > button {
+ flex: 1;
+ padding: 11px 8px 8px 8px;
+ border-bottom: solid 3px transparent;
+
+ &.active {
+ color: var(--accent);
+ border-bottom-color: var(--accent);
+ }
+ }
+
+ &.max-width_500px {
+ font-size: 80%;
+ }
+}
+</style>