revert: 650187deaf
This commit is contained in:
parent
6f7cfa82b5
commit
73f06e591a
31 changed files with 70 additions and 33 deletions
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<MfmCore :text="text" :plain="plain" :nowrap="nowrap" :author="author" :is-note="isNote" :class="[$style.root, { '_nowrap': nowrap }]"/>
|
||||
<MfmCore :text="text" :plain="plain" :nowrap="nowrap" :author="author" :is-note="isNote" :class="[$style.root, { [$style.nowrap]: nowrap }]"/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
@ -160,5 +160,12 @@ const props = withDefaults(defineProps<{
|
|||
<style lang="scss" module>
|
||||
.root {
|
||||
white-space: pre-wrap;
|
||||
|
||||
&.nowrap {
|
||||
white-space: pre;
|
||||
word-wrap: normal; // https://codeday.me/jp/qa/20190424/690106.html
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<i v-else-if="metadata.icon" :class="[$style.titleIcon, metadata.icon]"></i>
|
||||
|
||||
<div :class="$style.title">
|
||||
<span v-if="metadata.userName" class="_nowrap">{{ metadata.userName.name ?? metadata.userName.username }}</span>
|
||||
<MkUserName v-if="metadata.userName" :user="metadata.userName" :nowrap="true"/>
|
||||
<div v-else-if="metadata.title">{{ metadata.title }}</div>
|
||||
<div v-if="!narrow && metadata.subtitle" :class="$style.subtitle">
|
||||
{{ metadata.subtitle }}
|
||||
|
|
15
packages/frontend/src/components/global/MkUserName.vue
Normal file
15
packages/frontend/src/components/global/MkUserName.vue
Normal file
|
@ -0,0 +1,15 @@
|
|||
<template>
|
||||
<Mfm :text="user.name ?? user.username" :author="user" :plain="true" :nowrap="nowrap" :emoji-urls="user.emojis"/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { } from 'vue';
|
||||
import * as misskey from 'misskey-js';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
user: misskey.entities.User;
|
||||
nowrap?: boolean;
|
||||
}>(), {
|
||||
nowrap: true,
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue