2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
|
|
|
<header class="kkwtjztg">
|
2020-10-25 01:21:41 +09:00
|
|
|
<MkA class="name" :to="userPage(note.user)" v-user-preview="note.user.id">
|
2020-10-17 20:12:00 +09:00
|
|
|
<MkUserName :user="note.user"/>
|
2020-10-25 01:21:41 +09:00
|
|
|
</MkA>
|
2020-01-30 04:37:25 +09:00
|
|
|
<span class="is-bot" v-if="note.user.isBot">bot</span>
|
2020-10-17 20:12:00 +09:00
|
|
|
<span class="username"><MkAcct :user="note.user"/></span>
|
|
|
|
<span class="admin" v-if="note.user.isAdmin"><Fa :icon="faBookmark"/></span>
|
|
|
|
<span class="moderator" v-if="!note.user.isAdmin && note.user.isModerator"><Fa :icon="farBookmark"/></span>
|
2020-01-30 04:37:25 +09:00
|
|
|
<div class="info">
|
2020-10-17 20:12:00 +09:00
|
|
|
<span class="mobile" v-if="note.viaMobile"><Fa :icon="faMobileAlt"/></span>
|
2020-10-25 01:21:41 +09:00
|
|
|
<MkA class="created-at" :to="notePage(note)">
|
2020-10-17 20:12:00 +09:00
|
|
|
<MkTime :time="note.createdAt"/>
|
2020-10-25 01:21:41 +09:00
|
|
|
</MkA>
|
2020-05-16 22:06:39 +09:00
|
|
|
<span class="visibility" v-if="note.visibility !== 'public'">
|
2020-10-17 20:12:00 +09:00
|
|
|
<Fa v-if="note.visibility === 'home'" :icon="faHome"/>
|
|
|
|
<Fa v-if="note.visibility === 'followers'" :icon="faUnlock"/>
|
|
|
|
<Fa v-if="note.visibility === 'specified'" :icon="faEnvelope"/>
|
2020-01-30 04:37:25 +09:00
|
|
|
</span>
|
2020-10-17 20:12:00 +09:00
|
|
|
<span class="localOnly" v-if="note.localOnly"><Fa :icon="faBiohazard"/></span>
|
2020-01-30 04:37:25 +09:00
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 20:12:00 +09:00
|
|
|
import { defineComponent } from 'vue';
|
2020-05-16 22:06:39 +09:00
|
|
|
import { faHome, faUnlock, faEnvelope, faMobileAlt, faBookmark, faBiohazard } from '@fortawesome/free-solid-svg-icons';
|
2020-01-31 05:09:52 +09:00
|
|
|
import { faBookmark as farBookmark } from '@fortawesome/free-regular-svg-icons';
|
2020-10-17 20:12:00 +09:00
|
|
|
import notePage from '../filters/note';
|
|
|
|
import { userPage } from '../filters/user';
|
|
|
|
import * as os from '@/os';
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2020-10-17 20:12:00 +09:00
|
|
|
export default defineComponent({
|
2020-01-30 04:37:25 +09:00
|
|
|
props: {
|
|
|
|
note: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
2020-05-16 22:06:39 +09:00
|
|
|
faHome, faUnlock, faEnvelope, faMobileAlt, faBookmark, farBookmark, faBiohazard
|
2020-01-30 04:37:25 +09:00
|
|
|
};
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
notePage,
|
|
|
|
userPage
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.kkwtjztg {
|
|
|
|
display: flex;
|
|
|
|
align-items: baseline;
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
> .name {
|
|
|
|
display: block;
|
|
|
|
margin: 0 .5em 0 0;
|
|
|
|
padding: 0;
|
2021-03-02 22:57:16 +09:00
|
|
|
overflow: hidden;
|
2020-01-30 04:37:25 +09:00
|
|
|
font-size: 1em;
|
|
|
|
font-weight: bold;
|
|
|
|
text-decoration: none;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
text-decoration: underline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .is-bot {
|
|
|
|
flex-shrink: 0;
|
|
|
|
align-self: center;
|
|
|
|
margin: 0 .5em 0 0;
|
|
|
|
padding: 1px 6px;
|
|
|
|
font-size: 80%;
|
2020-01-31 05:09:52 +09:00
|
|
|
border: solid 1px var(--divider);
|
2020-01-30 04:37:25 +09:00
|
|
|
border-radius: 3px;
|
|
|
|
}
|
|
|
|
|
2020-01-31 05:21:41 +09:00
|
|
|
> .admin,
|
|
|
|
> .moderator {
|
|
|
|
margin-right: 0.5em;
|
2020-02-15 22:21:35 +09:00
|
|
|
color: var(--badge);
|
2020-01-31 05:21:41 +09:00
|
|
|
}
|
|
|
|
|
2020-01-30 04:37:25 +09:00
|
|
|
> .username {
|
|
|
|
margin: 0 .5em 0 0;
|
2021-03-02 22:57:16 +09:00
|
|
|
overflow: hidden;
|
2020-01-30 04:37:25 +09:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .info {
|
|
|
|
margin-left: auto;
|
|
|
|
font-size: 0.9em;
|
|
|
|
|
|
|
|
> .mobile {
|
|
|
|
margin-right: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .visibility {
|
|
|
|
margin-left: 8px;
|
|
|
|
}
|
2020-05-16 22:06:39 +09:00
|
|
|
|
|
|
|
> .localOnly {
|
|
|
|
margin-left: 8px;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|