enhance(frontend): ノートプレビューにCWが反映されるように (#12509)
* enhance(frontend): ノートプレビューにCWが反映されるように
* Update CHANGELOG.md
* refactor: 不要な条件を除去
* Revert "refactor: 不要な条件を除去"
This reverts commit e4eff689bd
.
* fix: やっぱり不要な条件だった
This commit is contained in:
@@ -11,7 +11,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<MkUserName :user="user" :nowrap="true"/>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<p v-if="useCw" :class="$style.cw">
|
||||
<Mfm v-if="cw != ''" :text="cw" :author="user" :nyaize="'respect'" :i="user" style="margin-right: 8px;"/>
|
||||
<MkCwButton v-model="showContent" :text="text.trim()" :files="files" :poll="poll" style="margin: 4px 0;"/>
|
||||
</p>
|
||||
<div v-show="!useCw || showContent">
|
||||
<Mfm :text="text.trim()" :author="user" :nyaize="'respect'" :i="user"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -20,11 +24,23 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import MkCwButton from '@/components/MkCwButton.vue';
|
||||
|
||||
const showContent = ref(false);
|
||||
|
||||
const props = defineProps<{
|
||||
text: string;
|
||||
files: Misskey.entities.DriveFile[];
|
||||
poll?: {
|
||||
choices: string[];
|
||||
multiple: boolean;
|
||||
expiresAt: string | null;
|
||||
expiredAfter: string | null;
|
||||
};
|
||||
useCw: boolean;
|
||||
cw: string | null;
|
||||
user: Misskey.entities.User;
|
||||
}>();
|
||||
</script>
|
||||
@@ -53,6 +69,14 @@ const props = defineProps<{
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.cw {
|
||||
cursor: default;
|
||||
display: block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.header {
|
||||
margin-bottom: 2px;
|
||||
font-weight: bold;
|
||||
|
Reference in New Issue
Block a user