2019-03-21 04:19:18 +01:00
|
|
|
<a {href}
|
2019-02-14 03:40:02 +01:00
|
|
|
rel="prefetch"
|
2019-03-21 04:19:18 +01:00
|
|
|
class="compose-box-avatar {loaded ? 'loaded' : 'not-loaded'}"
|
|
|
|
aria-hidden={!loaded}
|
2018-08-20 04:31:54 +02:00
|
|
|
aria-label="Profile for {accessibleName}">
|
2018-05-02 02:05:36 +02:00
|
|
|
<Avatar account={verifyCredentials} size="small"/>
|
2018-04-03 02:53:04 +02:00
|
|
|
</a>
|
2019-03-21 04:19:18 +01:00
|
|
|
<a class="compose-box-display-name {loaded ? 'loaded' : 'not-loaded'}"
|
|
|
|
{href}
|
|
|
|
aria-hidden={!loaded}
|
|
|
|
rel="prefetch">
|
2018-08-20 00:23:40 +02:00
|
|
|
<AccountDisplayName account={verifyCredentials} />
|
2018-02-27 06:54:21 +01:00
|
|
|
</a>
|
2019-03-21 04:19:18 +01:00
|
|
|
<span class="compose-box-handle {loaded ? 'loaded' : 'not-loaded'}"
|
|
|
|
aria-hidden={!loaded} >
|
2018-05-02 02:05:36 +02:00
|
|
|
{'@' + verifyCredentials.acct}
|
2018-02-27 06:54:21 +01:00
|
|
|
</span>
|
|
|
|
<style>
|
2018-04-03 02:53:04 +02:00
|
|
|
.compose-box-avatar {
|
2018-02-27 06:54:21 +01:00
|
|
|
grid-area: avatar;
|
|
|
|
margin-right: 15px;
|
|
|
|
}
|
|
|
|
.compose-box-display-name {
|
|
|
|
color: var(--deemphasized-text-color);
|
2018-03-04 00:44:43 +01:00
|
|
|
grid-area: name;
|
2018-02-27 06:54:21 +01:00
|
|
|
min-width: 0;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
font-size: 1.1em;
|
|
|
|
margin-left: 5px;
|
|
|
|
font-weight: 600;
|
|
|
|
}
|
|
|
|
.compose-box-display-name,
|
|
|
|
.compose-box-display-name:hover,
|
|
|
|
.compose-box-display-name:visited {
|
|
|
|
color: var(--body-text-color);
|
|
|
|
}
|
|
|
|
:global(.compose-box-handle) {
|
|
|
|
grid-area: handle;
|
|
|
|
color: var(--deemphasized-text-color);
|
|
|
|
min-width: 0;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
font-size: 1.1em;
|
|
|
|
margin-left: 5px;
|
|
|
|
}
|
2019-03-21 04:19:18 +01:00
|
|
|
.not-loaded {
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
.loaded {
|
|
|
|
visibility: visible;
|
|
|
|
}
|
2018-02-27 06:54:21 +01:00
|
|
|
|
|
|
|
@media (max-width: 767px) {
|
2018-04-03 02:53:04 +02:00
|
|
|
.compose-box-avatar {
|
2018-02-27 06:54:21 +01:00
|
|
|
grid-area: avatar;
|
|
|
|
margin-right: 5px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<script>
|
|
|
|
import Avatar from '../Avatar.html'
|
2018-03-14 01:14:57 +01:00
|
|
|
import { store } from '../../_store/store'
|
2018-08-20 00:23:40 +02:00
|
|
|
import AccountDisplayName from '../profile/AccountDisplayName.html'
|
2018-08-20 04:31:54 +02:00
|
|
|
import { removeEmoji } from '../../_utils/removeEmoji'
|
2019-03-21 04:19:18 +01:00
|
|
|
import { ONE_TRANSPARENT_PIXEL } from '../../_static/media'
|
2018-08-20 00:23:40 +02:00
|
|
|
|
2018-02-27 06:54:21 +01:00
|
|
|
export default {
|
|
|
|
components: {
|
2018-08-20 00:23:40 +02:00
|
|
|
Avatar,
|
|
|
|
AccountDisplayName
|
2018-03-03 19:11:32 +01:00
|
|
|
},
|
2018-03-14 01:14:57 +01:00
|
|
|
store: () => store,
|
2018-03-03 19:11:32 +01:00
|
|
|
computed: {
|
2019-03-21 04:19:18 +01:00
|
|
|
loaded: ({ $currentVerifyCredentials }) => !!$currentVerifyCredentials,
|
|
|
|
verifyCredentials: ({ $currentVerifyCredentials }) => {
|
|
|
|
// return a placeholder while we're waiting on IndexedDB to load
|
|
|
|
// (https://github.com/nolanlawson/pinafore/issues/1076)
|
|
|
|
return $currentVerifyCredentials || {
|
|
|
|
display_name: '',
|
|
|
|
acct: '',
|
|
|
|
avatar: ONE_TRANSPARENT_PIXEL,
|
|
|
|
avatar_static: ONE_TRANSPARENT_PIXEL
|
|
|
|
}
|
|
|
|
},
|
|
|
|
id: ({ verifyCredentials }) => (verifyCredentials && verifyCredentials.id),
|
|
|
|
href: ({ id }) => (id ? `/accounts/${id}` : '#'),
|
2018-08-20 04:31:54 +02:00
|
|
|
emojis: ({ verifyCredentials }) => (verifyCredentials.emojis || []),
|
2019-03-22 23:55:33 +01:00
|
|
|
displayName: ({ verifyCredentials }) => verifyCredentials.display_name || verifyCredentials.username || '',
|
2018-08-20 04:31:54 +02:00
|
|
|
accessibleName: ({ displayName, emojis, $omitEmojiInDisplayNames }) => {
|
|
|
|
if ($omitEmojiInDisplayNames) {
|
2019-03-22 23:55:33 +01:00
|
|
|
return removeEmoji(displayName, emojis) || displayName
|
2018-08-20 04:31:54 +02:00
|
|
|
}
|
2019-03-22 23:55:33 +01:00
|
|
|
return displayName
|
2018-08-20 04:31:54 +02:00
|
|
|
}
|
2018-02-27 06:54:21 +01:00
|
|
|
}
|
|
|
|
}
|
2019-02-14 03:40:02 +01:00
|
|
|
</script>
|