2019-02-23 05:35:19 +01:00
|
|
|
<div class="account-profile-moved-banner">
|
|
|
|
<Avatar className="from-avatar" size="extra-small" {account} />
|
|
|
|
<div class="moved-label">
|
2019-03-03 04:02:06 +01:00
|
|
|
<SvgIcon className="moved-svg" href="#fa-suitcase" />
|
2020-11-29 23:13:27 +01:00
|
|
|
{hasMovedLabel}
|
2019-02-23 05:35:19 +01:00
|
|
|
</div>
|
|
|
|
<a class="moved-avatar" href="/accounts/{moved.id}">
|
|
|
|
<Avatar account={moved} />
|
|
|
|
</a>
|
|
|
|
<a class="moved-to-name" href="/accounts/{moved.id}" title="@{moved.acct}">{movedAccessibleName}</a>
|
|
|
|
<a class="moved-to-acct" href="/accounts/{moved.id}">@{moved.acct}</a>
|
|
|
|
</div>
|
|
|
|
<style>
|
|
|
|
.account-profile-moved-banner {
|
|
|
|
display: grid;
|
|
|
|
grid-template-areas: "from-avatar label"
|
|
|
|
"avatar name"
|
|
|
|
"avatar acct";
|
|
|
|
grid-template-columns: max-content 1fr;
|
|
|
|
margin: 10px 20px;
|
|
|
|
grid-row-gap: 10px;
|
|
|
|
grid-column-gap: 20px;
|
|
|
|
}
|
|
|
|
:global(.from-avatar) {
|
|
|
|
grid-area: from-avatar;
|
|
|
|
justify-self: flex-end;
|
|
|
|
}
|
2019-03-03 04:02:06 +01:00
|
|
|
:global(.moved-svg) {
|
2019-02-23 05:35:19 +01:00
|
|
|
width: 18px;
|
|
|
|
height: 18px;
|
|
|
|
fill: var(--deemphasized-text-color);
|
|
|
|
margin-right: 5px;
|
|
|
|
}
|
|
|
|
.moved-label, .moved-to-acct, .moved-to-name {
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
.moved-avatar {
|
|
|
|
grid-area: avatar;
|
|
|
|
}
|
|
|
|
.moved-label {
|
|
|
|
grid-area: label;
|
|
|
|
}
|
|
|
|
.moved-to-acct {
|
|
|
|
grid-area: acct;
|
|
|
|
font-size: 1.2em;
|
|
|
|
}
|
|
|
|
.moved-to-name {
|
|
|
|
grid-area: name;
|
|
|
|
font-weight: 600;
|
|
|
|
font-size: 1.1em;
|
|
|
|
text-decoration: none;
|
|
|
|
color: var(--body-text-color);
|
|
|
|
}
|
|
|
|
.moved-to-name:hover {
|
|
|
|
text-decoration: underline;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
<script>
|
2021-07-05 05:19:04 +02:00
|
|
|
import { removeEmoji } from '../../_utils/removeEmoji.js'
|
2019-02-23 05:35:19 +01:00
|
|
|
import Avatar from '../Avatar.html'
|
2019-03-03 04:02:06 +01:00
|
|
|
import SvgIcon from '../SvgIcon.html'
|
2021-07-05 05:19:04 +02:00
|
|
|
import { formatIntl } from '../../_utils/formatIntl.js'
|
2019-02-23 05:35:19 +01:00
|
|
|
|
|
|
|
export default {
|
|
|
|
computed: {
|
|
|
|
emojis: ({ account }) => (account.emojis || []),
|
|
|
|
displayName: ({ account }) => account.display_name || account.username,
|
|
|
|
accessibleName: ({ displayName, emojis, $omitEmojiInDisplayNames }) => {
|
|
|
|
return $omitEmojiInDisplayNames
|
|
|
|
? removeEmoji(displayName, emojis) || displayName
|
|
|
|
: displayName
|
|
|
|
},
|
|
|
|
moved: ({ account }) => account.moved,
|
|
|
|
movedEmojis: ({ moved }) => (moved.emojis || []),
|
|
|
|
movedDisplayName: ({ moved }) => moved.display_name || moved.username,
|
|
|
|
movedAccessibleName: ({ movedDisplayName, movedEmojis, $omitEmojiInDisplayNames }) => {
|
|
|
|
return $omitEmojiInDisplayNames
|
|
|
|
? removeEmoji(movedDisplayName, movedEmojis) || movedDisplayName
|
|
|
|
: movedDisplayName
|
2020-11-29 23:13:27 +01:00
|
|
|
},
|
|
|
|
hasMovedLabel: ({ accessibleName }) => (
|
|
|
|
formatIntl('intl.accountHasMoved', { account: accessibleName })
|
|
|
|
)
|
2019-02-23 05:35:19 +01:00
|
|
|
},
|
|
|
|
components: {
|
2019-03-03 04:02:06 +01:00
|
|
|
Avatar,
|
|
|
|
SvgIcon
|
2019-02-23 05:35:19 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|