Use mk-user-name
This commit is contained in:
syuilo 2018-12-06 16:09:33 +09:00
parent a235869cfa
commit dea8688c9d
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
19 changed files with 43 additions and 54 deletions

View file

@ -2,7 +2,7 @@
<header class="bvonvjxbwzaiskogyhbwgyxvcgserpmu">
<mk-avatar class="avatar" :user="note.user" v-if="$store.state.device.postStyle == 'smart'"/>
<router-link class="name" :to="note.user | userPage" v-user-preview="note.user.id">
<misskey-flavored-markdown :text="note.user.name || note.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="note.user.emojis"/>
<mk-user-name :user="note.user"/>
</router-link>
<span class="is-admin" v-if="note.user.isAdmin">admin</span>
<span class="is-bot" v-if="note.user.isBot">bot</span>

View file

@ -4,7 +4,7 @@
<fa icon="retweet"/>
<i18n path="@.renoted-by" tag="span">
<router-link class="name" :to="note.user | userPage" v-user-preview="note.userId" place="user">
<misskey-flavored-markdown :text="note.user.name || note.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="note.user.emojis"/>
<mk-user-name :user="note.user"/>
</router-link>
</i18n>
<div class="info">

View file

@ -6,7 +6,7 @@
<div class="body">
<header>
<router-link class="name" :to="note.user | userPage" v-user-preview="note.user.id">
<misskey-flavored-markdown :text="note.user.name || note.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="note.user.emojis"/>
<mk-user-name :user="note.user"/>
</router-link>
<span class="username">@{{ note.user | acct }}</span>
<div class="info">

View file

@ -21,7 +21,7 @@
<mk-avatar class="avatar" :user="appearNote.user"/>
<header>
<router-link class="name" :to="appearNote.user | userPage" v-user-preview="appearNote.user.id">
<misskey-flavored-markdown :text="appearNote.user.name || appearNote.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="appearNote.user.emojis"/>
<mk-user-name :user="appearNote.user"/>
</router-link>
<span class="username"><mk-acct :user="appearNote.user"/></span>
<div class="info">

View file

@ -19,7 +19,7 @@
<p>
<mk-reaction-icon :reaction="notification.reaction"/>
<router-link :to="notification.user | userPage" v-user-preview="notification.user.id">
<misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/>
<mk-user-name :user="notification.user"/>
</router-link>
</p>
<router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note)">
@ -33,7 +33,7 @@
<div class="text">
<p><fa icon="retweet"/>
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId">
<misskey-flavored-markdown :text="notification.note.user.name || notification.note.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.note.user.emojis"/>
<mk-user-name :user="notification.note.user"/>
</router-link>
</p>
<router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note.renote)">
@ -47,7 +47,7 @@
<div class="text">
<p><fa icon="quote-left"/>
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId">
<misskey-flavored-markdown :text="notification.note.user.name || notification.note.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.note.user.emojis"/>
<mk-user-name :user="notification.note.user"/>
</router-link>
</p>
<router-link class="note-preview" :to="notification.note | notePage" :title="getNoteSummary(notification.note)">{{ getNoteSummary(notification.note) }}</router-link>
@ -59,7 +59,7 @@
<div class="text">
<p><fa icon="user-plus"/>
<router-link :to="notification.user | userPage" v-user-preview="notification.user.id">
<misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/>
<mk-user-name :user="notification.user"/>
</router-link>
</p>
</div>
@ -70,7 +70,7 @@
<div class="text">
<p><fa icon="user-clock"/>
<router-link :to="notification.user | userPage" v-user-preview="notification.user.id">
<misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/>
<mk-user-name :user="notification.user"/>
</router-link>
</p>
</div>
@ -81,7 +81,7 @@
<div class="text">
<p><fa icon="reply"/>
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId">
<misskey-flavored-markdown :text="notification.note.user.name || notification.note.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.note.user.emojis"/>
<mk-user-name :user="notification.note.user"/>
</router-link>
</p>
<router-link class="note-preview" :to="notification.note | notePage" :title="getNoteSummary(notification.note)">{{ getNoteSummary(notification.note) }}</router-link>
@ -93,7 +93,7 @@
<div class="text">
<p><fa icon="at"/>
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId">
<misskey-flavored-markdown :text="notification.note.user.name || notification.note.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.note.user.emojis"/>
<mk-user-name :user="notification.note.user"/>
</router-link>
</p>
<a class="note-preview" :href="notification.note | notePage" :title="getNoteSummary(notification.note)">{{ getNoteSummary(notification.note) }}</a>
@ -104,7 +104,7 @@
<mk-avatar class="avatar" :user="notification.user"/>
<div class="text">
<p><fa icon="chart-pie"/><a :href="notification.user | userPage" v-user-preview="notification.user.id">
<misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/>
<mk-user-name :user="notification.user"/>
</a></p>
<router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note)">
<fa icon="quote-left"/>{{ getNoteSummary(notification.note) }}<fa icon="quote-right"/>

View file

@ -8,8 +8,8 @@
<div class="content">
<div v-if="visibility == 'specified'" class="visibleUsers">
<span v-for="u in visibleUsers">
<misskey-flavored-markdown :text="u.name || u.username" :shouldBreak="false" :plainText="true" :custom-emojis="u.emojis"/>
<a @click="removeVisibleUser(u)">[x]</a></span>
<mk-user-name :user="u"/><a @click="removeVisibleUser(u)">[x]</a>
</span>
<a @click="addVisibleUser">{{ $t('add-visible-user') }}</a>
</div>
<div class="hashtags" v-if="recentHashtags.length > 0 && $store.state.settings.suggestRecentHashtags">

View file

@ -5,7 +5,7 @@
<div class="slpqaxdoxhvglersgjukmvizkqbmbokc">
<div v-for="req in requests">
<router-link :key="req.id" :to="req.follower | userPage">
<misskey-flavored-markdown :text="req.follower.name || req.follower.username" :shouldBreak="false" :plainText="true" :custom-emojis="req.follower.emojis"/>
<mk-user-name :user="req.follower"/>
</router-link>
<span>
<a @click="accept(req.follower)">{{ $t('accept') }}</a>|<a @click="reject(req.follower)">{{ $t('reject') }}</a>

View file

@ -4,9 +4,7 @@
<div class="banner" :style="u.bannerUrl ? `background-image: url(${u.bannerUrl})` : ''"></div>
<mk-avatar class="avatar" :user="u" :disable-preview="true"/>
<div class="title">
<router-link class="name" :to="u | userPage">
<misskey-flavored-markdown :text="u.name || u.username" :shouldBreak="false" :plainText="true" :custom-emojis="u.emojis"/>
</router-link>
<router-link class="name" :to="u | userPage"><mk-user-name :user="u"/></router-link>
<p class="username"><mk-acct :user="u"/></p>
</div>
<div class="description">

View file

@ -6,7 +6,7 @@
<header>
<mk-reaction-icon :reaction="notification.reaction"/>
<router-link :to="notification.user | userPage">
<misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/>
<mk-user-name :user="notification.user"/>
</router-link>
<mk-time :time="notification.createdAt"/>
</header>
@ -23,7 +23,7 @@
<header>
<fa icon="retweet"/>
<router-link :to="notification.user | userPage">
<misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/>
<mk-user-name :user="notification.user"/>
</router-link>
<mk-time :time="notification.createdAt"/>
</header>
@ -39,7 +39,7 @@
<header>
<fa icon="user-plus"/>
<router-link :to="notification.user | userPage">
<misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/>
<mk-user-name :user="notification.user"/>
</router-link>
<mk-time :time="notification.createdAt"/>
</header>
@ -52,7 +52,7 @@
<header>
<fa icon="user-clock"/>
<router-link :to="notification.user | userPage">
<misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/>
<mk-user-name :user="notification.user"/>
</router-link>
<mk-time :time="notification.createdAt"/>
</header>
@ -65,7 +65,7 @@
<header>
<fa icon="chart-pie"/>
<router-link :to="notification.user | userPage">
<misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/>
<mk-user-name :user="notification.user"/>
</router-link>
<mk-time :time="notification.createdAt"/>
</header>

View file

@ -15,9 +15,7 @@
@click="() => os.apis.updateAvatar()"
:title="$t('update-avatar')"
/>
<router-link class="name" :to="$store.state.i | userPage">
<misskey-flavored-markdown :text="$store.state.i.name || $store.state.i.username" :shouldBreak="false" :plainText="true" :custom-emojis="$store.state.i.emojis"/>
</router-link>
<router-link class="name" :to="$store.state.i | userPage"><mk-user-name :user="$store.state.i"/></router-link>
<p class="username">@{{ $store.state.i | acct }}</p>
</div>
</mk-widget-container>

View file

@ -13,9 +13,7 @@
<div class="user" v-for="_user in users">
<mk-avatar class="avatar" :user="_user"/>
<div class="body">
<router-link class="name" :to="_user | userPage" v-user-preview="_user.id">
<misskey-flavored-markdown :text="_user.name || _user.username" :shouldBreak="false" :plainText="true" :custom-emojis="_user.emojis"/>
</router-link>
<router-link class="name" :to="_user | userPage" v-user-preview="_user.id"><mk-user-name :user="_user"/></router-link>
<p class="username">@{{ _user | acct }}</p>
</div>
</div>

View file

@ -2,9 +2,8 @@
<div class="mk-note-card">
<a :href="note | notePage">
<header>
<img :src="note.user.avatarUrl" alt="avatar"/><h3>
<misskey-flavored-markdown :text="note.user.name || note.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="note.user.emojis"/>
</h3>
<img :src="note.user.avatarUrl" alt="avatar"/>
<h3><mk-user-name :user="note.user"/></h3>
</header>
<div>
{{ text }}

View file

@ -20,9 +20,7 @@
<header>
<mk-avatar class="avatar" :user="appearNote.user"/>
<div>
<router-link class="name" :to="appearNote.user | userPage">
<misskey-flavored-markdown :text="appearNote.user.name || appearNote.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="appearNote.user.emojis"/>
</router-link>
<router-link class="name" :to="appearNote.user | userPage"><mk-user-name :user="appearNote.user"/></router-link>
<span class="username"><mk-acct :user="appearNote.user"/></span>
</div>
</header>

View file

@ -3,7 +3,7 @@
<template v-if="notification.type == 'reaction'">
<mk-avatar class="avatar" :user="notification.user"/>
<div class="text">
<p><mk-reaction-icon :reaction="notification.reaction"/><misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/></p>
<p><mk-reaction-icon :reaction="notification.reaction"/><mk-user-name :user="notification.user"/></p>
<p class="note-ref"><fa icon="quote-left"/>{{ getNoteSummary(notification.note) }}<fa icon="quote-right"/></p>
</div>
</template>
@ -11,7 +11,7 @@
<template v-if="notification.type == 'renote'">
<mk-avatar class="avatar" :user="notification.note.user"/>
<div class="text">
<p><fa icon="retweet"/><misskey-flavored-markdown :text="notification.note.user.name || notification.note.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.note.user.emojis"/></p>
<p><fa icon="retweet"/><mk-user-name :user="notification.note.user"/></p>
<p class="note-ref"><fa icon="quote-left"/>{{ getNoteSummary(notification.note.renote) }}<fa icon="quote-right"/></p>
</div>
</template>
@ -19,7 +19,7 @@
<template v-if="notification.type == 'quote'">
<mk-avatar class="avatar" :user="notification.note.user"/>
<div class="text">
<p><fa icon="quote-left"/><misskey-flavored-markdown :text="notification.note.user.name || notification.note.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.note.user.emojis"/></p>
<p><fa icon="quote-left"/><mk-user-name :user="notification.note.user"/></p>
<p class="note-preview">{{ getNoteSummary(notification.note) }}</p>
</div>
</template>
@ -27,21 +27,21 @@
<template v-if="notification.type == 'follow'">
<mk-avatar class="avatar" :user="notification.user"/>
<div class="text">
<p><fa icon="user-plus"/><misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/></p>
<p><fa icon="user-plus"/><mk-user-name :user="notification.user"/></p>
</div>
</template>
<template v-if="notification.type == 'receiveFollowRequest'">
<mk-avatar class="avatar" :user="notification.user"/>
<div class="text">
<p><fa icon="user-clock"/><misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/></p>
<p><fa icon="user-clock"/><mk-user-name :user="notification.user"/></p>
</div>
</template>
<template v-if="notification.type == 'reply'">
<mk-avatar class="avatar" :user="notification.note.user"/>
<div class="text">
<p><fa icon="reply"/><misskey-flavored-markdown :text="notification.note.user.name || notification.note.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.note.user.emojis"/></p>
<p><fa icon="reply"/><mk-user-name :user="notification.note.user"/></p>
<p class="note-preview">{{ getNoteSummary(notification.note) }}</p>
</div>
</template>
@ -49,7 +49,7 @@
<template v-if="notification.type == 'mention'">
<mk-avatar class="avatar" :user="notification.note.user"/>
<div class="text">
<p><fa icon="at"/><misskey-flavored-markdown :text="notification.note.user.name || notification.note.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.note.user.emojis"/></p>
<p><fa icon="at"/><mk-user-name :user="notification.note.user"/></p>
<p class="note-preview">{{ getNoteSummary(notification.note) }}</p>
</div>
</template>
@ -57,7 +57,7 @@
<template v-if="notification.type == 'poll_vote'">
<mk-avatar class="avatar" :user="notification.user"/>
<div class="text">
<p><fa icon="chart-pie"/><misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/></p>
<p><fa icon="chart-pie"/><mk-user-name :user="notification.user"/></p>
<p class="note-ref"><fa icon="quote-left"/>{{ getNoteSummary(notification.note) }}<fa icon="quote-right"/></p>
</div>
</template>

View file

@ -5,7 +5,7 @@
<div>
<header>
<mk-reaction-icon :reaction="notification.reaction"/>
<router-link :to="notification.user | userPage"><misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/></router-link>
<router-link :to="notification.user | userPage"><mk-user-name :user="notification.user"/></router-link>
<mk-time :time="notification.createdAt"/>
</header>
<router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note)">
@ -20,7 +20,7 @@
<div>
<header>
<fa icon="retweet"/>
<router-link :to="notification.user | userPage"><misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/></router-link>
<router-link :to="notification.user | userPage"><mk-user-name :user="notification.user"/></router-link>
<mk-time :time="notification.createdAt"/>
</header>
<router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note.renote)">
@ -34,7 +34,7 @@
<div>
<header>
<fa icon="user-plus"/>
<router-link :to="notification.user | userPage"><misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/></router-link>
<router-link :to="notification.user | userPage"><mk-user-name :user="notification.user"/></router-link>
<mk-time :time="notification.createdAt"/>
</header>
</div>
@ -45,7 +45,7 @@
<div>
<header>
<fa icon="user-clock"/>
<router-link :to="notification.user | userPage"><misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/></router-link>
<router-link :to="notification.user | userPage"><mk-user-name :user="notification.user"/></router-link>
<mk-time :time="notification.createdAt"/>
</header>
</div>
@ -56,7 +56,7 @@
<div>
<header>
<fa icon="chart-pie"/>
<router-link :to="notification.user | userPage"><misskey-flavored-markdown :text="notification.user.name || notification.user.username" :shouldBreak="false" :plainText="true" :custom-emojis="notification.user.emojis"/></router-link>
<router-link :to="notification.user | userPage"><mk-user-name :user="notification.user"/></router-link>
<mk-time :time="notification.createdAt"/>
</header>
<router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note)">

View file

@ -14,7 +14,7 @@
<mk-note-preview class="preview" v-if="renote" :note="renote"/>
<div v-if="visibility == 'specified'" class="visibleUsers">
<span v-for="u in visibleUsers">
<misskey-flavored-markdown :text="u.name || u.username" :shouldBreak="false" :plainText="true" :custom-emojis="u.emojis"/>
<mk-user-name :user="u"/>
<a @click="removeVisibleUser(u)">[x]</a>
</span>
<a @click="addVisibleUser">+{{ $t('add-visible-user') }}</a>

View file

@ -11,9 +11,7 @@
<div class="body" v-if="isOpen">
<router-link class="me" v-if="$store.getters.isSignedIn" :to="`/@${$store.state.i.username}`">
<img class="avatar" :src="$store.state.i.avatarUrl" alt="avatar"/>
<p class="name">
<misskey-flavored-markdown :text="$store.state.i.name || $store.state.i.username" :shouldBreak="false" :plainText="true" :custom-emojis="$store.state.i.emojis"/>
</p>
<p class="name"><mk-user-name :user="$store.state.i"/></p>
</router-link>
<div class="links">
<ul>

View file

@ -5,7 +5,7 @@
<main>
<div v-for="req in requests">
<router-link :key="req.id" :to="req.follower | userPage">
<misskey-flavored-markdown :text="req.follower.name || req.follower.username" :shouldBreak="false" :plainText="true" :custom-emojis="req.follower.emojis"/>
<mk-user-name :user="req.follower"/>
</router-link>
<span>
<a @click="accept(req.follower)">{{ $t('accept') }}</a>|<a @click="reject(req.follower)">{{ $t('reject') }}</a>

View file

@ -9,7 +9,7 @@
alt="avatar"
/>
<router-link :class="$style.name" :to="$store.state.i | userPage">
<misskey-flavored-markdown :text="$store.state.i.name || $store.state.i.username" :shouldBreak="false" :plainText="true" :custom-emojis="$store.state.i.emojis"/>
<mk-user-name :user="$store.state.i"/>
</router-link>
</mk-widget-container>
</div>