2021-03-02 02:59:41 +01:00
|
|
|
<template>
|
|
|
|
<div class="notified-status">
|
|
|
|
<div class="action">
|
|
|
|
<div class="action-mark">
|
2022-05-21 17:28:50 +02:00
|
|
|
<font-awesome-icon icon="home" size="sm" />
|
2021-03-02 02:59:41 +01:00
|
|
|
</div>
|
|
|
|
<div class="action-detail">
|
2021-10-13 15:47:52 +02:00
|
|
|
<span class="bold" @click="openUser(message.account)">
|
|
|
|
<bdi
|
|
|
|
v-html="
|
|
|
|
$t('notification.status.body', {
|
|
|
|
username: username(message.account),
|
2022-04-23 16:14:26 +02:00
|
|
|
interpolation: { escapeValue: false }
|
2021-10-13 15:47:52 +02:00
|
|
|
})
|
|
|
|
"
|
|
|
|
></bdi>
|
|
|
|
</span>
|
2021-03-02 02:59:41 +01:00
|
|
|
</div>
|
|
|
|
<div class="action-icon" role="presentation">
|
2022-04-23 16:14:26 +02:00
|
|
|
<FailoverImg :src="message.account.avatar" :alt="`Avatar of ${message.account.username}`" />
|
2021-03-02 02:59:41 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
<toot
|
|
|
|
:message="message.status"
|
2021-05-22 07:33:57 +02:00
|
|
|
:filters="filters"
|
2021-03-02 02:59:41 +01:00
|
|
|
:focused="focused"
|
|
|
|
:overlaid="overlaid"
|
|
|
|
v-on:update="updateToot"
|
|
|
|
v-on:delete="deleteToot"
|
|
|
|
@focusRight="$emit('focusRight')"
|
|
|
|
@selectToot="$emit('select')"
|
|
|
|
>
|
|
|
|
</toot>
|
2021-03-23 17:14:54 +01:00
|
|
|
<div class="clearfix"></div>
|
2021-03-02 02:59:41 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-05-22 09:29:08 +02:00
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent, PropType, computed } from 'vue'
|
|
|
|
import { Entity } from 'megalodon'
|
|
|
|
import { useStore } from '@/store'
|
|
|
|
import FailoverImg from '@/components/atoms/FailoverImg.vue'
|
|
|
|
import Toot from '../Toot.vue'
|
|
|
|
import { usernameWithStyle } from '@/utils/username'
|
|
|
|
import { MUTATION_TYPES as SIDEBAR_MUTATION, ACTION_TYPES as SIDEBAR_ACTION } from '@/store/TimelineSpace/Contents/SideBar'
|
|
|
|
import { ACTION_TYPES as PROFILE_ACTION } from '@/store/TimelineSpace/Contents/SideBar/AccountProfile'
|
2021-03-02 02:59:41 +01:00
|
|
|
|
2022-05-22 09:29:08 +02:00
|
|
|
export default defineComponent({
|
2021-03-02 02:59:41 +01:00
|
|
|
name: 'mention',
|
|
|
|
props: {
|
|
|
|
message: {
|
2022-05-22 09:29:08 +02:00
|
|
|
type: Object as PropType<Entity.Notification>,
|
2022-04-23 16:14:26 +02:00
|
|
|
default: {}
|
2021-03-02 02:59:41 +01:00
|
|
|
},
|
2021-05-22 07:33:57 +02:00
|
|
|
filters: {
|
2022-05-22 09:29:08 +02:00
|
|
|
type: Array as PropType<Array<Entity.Filter>>,
|
2022-04-23 16:14:26 +02:00
|
|
|
default: []
|
2021-03-02 02:59:41 +01:00
|
|
|
},
|
|
|
|
focused: {
|
|
|
|
type: Boolean,
|
2022-04-23 16:14:26 +02:00
|
|
|
default: false
|
2021-03-02 02:59:41 +01:00
|
|
|
},
|
|
|
|
overlaid: {
|
|
|
|
type: Boolean,
|
2022-04-23 16:14:26 +02:00
|
|
|
default: false
|
|
|
|
}
|
2021-03-02 02:59:41 +01:00
|
|
|
},
|
2021-03-23 17:14:54 +01:00
|
|
|
components: { Toot, FailoverImg },
|
2022-05-22 09:29:08 +02:00
|
|
|
setup(_props, ctx) {
|
|
|
|
const store = useStore()
|
|
|
|
|
|
|
|
const displayNameStyle = computed(() => store.state.App.displayNameStyle)
|
|
|
|
|
|
|
|
const updateToot = (message: Entity.Status) => {
|
|
|
|
return ctx.emit('update', message)
|
|
|
|
}
|
|
|
|
const deleteToot = (message: Entity.Status) => {
|
|
|
|
return ctx.emit('delete', message)
|
|
|
|
}
|
|
|
|
const username = (account: Entity.Account) => usernameWithStyle(account, displayNameStyle.value)
|
|
|
|
const openUser = (account: Entity.Account) => {
|
|
|
|
store.dispatch(`TimelineSpace/Contents/SideBar/${SIDEBAR_ACTION.OPEN_ACCOUNT_COMPONENT}`)
|
|
|
|
store.dispatch(`TimelineSpace/Contents/SideBar/AccountProfile/${PROFILE_ACTION.CHANGE_ACCOUNT}`, account)
|
|
|
|
store.commit(`TimelineSpace/Contents/SideBar/${SIDEBAR_MUTATION.CHANGE_OPEN_SIDEBAR}`, true)
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
updateToot,
|
|
|
|
deleteToot,
|
|
|
|
username,
|
|
|
|
openUser
|
2022-04-23 16:14:26 +02:00
|
|
|
}
|
|
|
|
}
|
2022-05-22 09:29:08 +02:00
|
|
|
})
|
2021-03-02 02:59:41 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.bold {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
2021-03-23 17:14:54 +01:00
|
|
|
.notified-status {
|
|
|
|
padding-top: 8px;
|
2021-03-23 17:28:10 +01:00
|
|
|
|
2021-03-23 17:14:54 +01:00
|
|
|
.action {
|
|
|
|
padding: 0 0 0 16px;
|
|
|
|
margin-right: 8px;
|
2021-03-02 02:59:41 +01:00
|
|
|
|
2021-03-23 17:14:54 +01:00
|
|
|
.action-mark {
|
|
|
|
color: #409eff;
|
|
|
|
float: left;
|
|
|
|
width: 32px;
|
|
|
|
text-align: right;
|
|
|
|
}
|
2021-03-02 02:59:41 +01:00
|
|
|
|
2021-03-23 17:14:54 +01:00
|
|
|
.action-detail {
|
|
|
|
margin-left: 10px;
|
|
|
|
font-size: var(--base-font-size);
|
|
|
|
float: left;
|
|
|
|
max-width: 80%;
|
2021-03-02 02:59:41 +01:00
|
|
|
|
2022-04-23 16:14:26 +02:00
|
|
|
.bold {
|
2021-03-23 17:14:54 +01:00
|
|
|
cursor: pointer;
|
2022-04-23 16:14:26 +02:00
|
|
|
}
|
2021-03-02 02:59:41 +01:00
|
|
|
|
2022-04-23 16:14:26 +02:00
|
|
|
.bold :deep(.emojione) {
|
|
|
|
max-width: 14px;
|
|
|
|
max-height: 14px;
|
2021-03-02 02:59:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-23 17:14:54 +01:00
|
|
|
.action-icon {
|
|
|
|
width: 100%;
|
|
|
|
text-align: right;
|
2021-03-02 02:59:41 +01:00
|
|
|
|
2021-03-23 17:14:54 +01:00
|
|
|
img {
|
|
|
|
width: 16px;
|
|
|
|
height: 16px;
|
|
|
|
border-radius: 2px;
|
|
|
|
}
|
2021-03-02 02:59:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|