2019-05-26 09:54:35 -07:00
|
|
|
<div class="status-header {isStatusInNotification ? 'status-in-notification' : ''} {notificationType === 'follow' ? 'header-is-follow' : ''}">
|
|
|
|
<div class="status-header-avatar {timelineType === 'pinned' || notificationType === 'poll' ? 'hidden' : ''}">
|
2018-05-01 17:05:36 -07:00
|
|
|
<Avatar {account} size="extra-small"/>
|
2018-03-30 17:30:30 -07:00
|
|
|
</div>
|
2019-03-02 19:02:06 -08:00
|
|
|
<SvgIcon className="status-header-svg" href={icon} />
|
2018-06-09 15:04:47 -07:00
|
|
|
|
|
|
|
<div class="status-header-content">
|
2018-05-01 17:05:36 -07:00
|
|
|
{#if timelineType === 'pinned'}
|
2018-06-09 15:04:47 -07:00
|
|
|
<span class="status-header-author">
|
|
|
|
Pinned toot
|
|
|
|
</span>
|
2019-05-26 09:54:35 -07:00
|
|
|
{:elseif notificationType !== 'poll'}
|
2019-02-23 12:32:00 -08:00
|
|
|
<a id={elementId}
|
|
|
|
href="/accounts/{accountId}"
|
2019-02-13 18:40:02 -08:00
|
|
|
rel="prefetch"
|
2018-06-09 15:04:47 -07:00
|
|
|
class="status-header-author"
|
2018-05-01 17:05:36 -07:00
|
|
|
title="{'@' + account.acct}"
|
2019-02-23 12:32:00 -08:00
|
|
|
>
|
2018-08-19 15:23:40 -07:00
|
|
|
<AccountDisplayName {account} />
|
2018-02-11 10:35:25 -08:00
|
|
|
</a>
|
2018-05-01 17:05:36 -07:00
|
|
|
{/if}
|
2018-06-09 15:04:47 -07:00
|
|
|
|
2019-05-26 09:54:35 -07:00
|
|
|
<span class="status-header-action">{actionText}</span>
|
2018-06-09 15:04:47 -07:00
|
|
|
</div>
|
2018-02-04 10:05:01 -08:00
|
|
|
</div>
|
|
|
|
<style>
|
|
|
|
.status-header {
|
2018-02-09 20:07:48 -08:00
|
|
|
grid-area: header;
|
2018-04-01 02:54:40 -07:00
|
|
|
margin: 0 10px 5px 5px;
|
2018-02-04 10:05:01 -08:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
2018-04-01 02:54:40 -07:00
|
|
|
.status-header.header-is-follow {
|
|
|
|
margin-bottom: 0; /* standalone, so doesn't need a bottom margin */
|
|
|
|
}
|
2018-02-04 10:05:01 -08:00
|
|
|
|
2018-03-30 17:30:30 -07:00
|
|
|
.status-header-avatar {
|
2018-03-22 21:36:19 -07:00
|
|
|
margin-left: 19px; /* offset for avatar, 48px - 24px - 5px */
|
|
|
|
}
|
|
|
|
|
2019-03-02 19:02:06 -08:00
|
|
|
:global(.status-header-svg) {
|
2018-06-09 15:04:47 -07:00
|
|
|
min-width: 18px;
|
2018-03-22 21:36:19 -07:00
|
|
|
margin-left: 20px;
|
2018-02-04 10:05:01 -08:00
|
|
|
width: 18px;
|
|
|
|
height: 18px;
|
|
|
|
fill: var(--deemphasized-text-color);
|
|
|
|
}
|
2018-02-04 12:49:42 -08:00
|
|
|
|
2019-03-02 19:02:06 -08:00
|
|
|
:global(.status-header.status-in-notification .status-header-svg) {
|
2018-02-04 12:49:42 -08:00
|
|
|
fill: var(--body-text-color);
|
|
|
|
}
|
2018-03-22 21:36:19 -07:00
|
|
|
|
2018-06-09 15:04:47 -07:00
|
|
|
.status-header-content {
|
|
|
|
display: flex;
|
|
|
|
flex: 1;
|
|
|
|
min-width: 0;
|
|
|
|
width: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.status-header-author {
|
2018-03-22 21:36:19 -07:00
|
|
|
margin-left: 5px;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
2018-06-09 15:04:47 -07:00
|
|
|
min-width: 0;
|
2018-03-22 21:36:19 -07:00
|
|
|
}
|
|
|
|
|
2018-06-09 15:04:47 -07:00
|
|
|
.status-header-action {
|
|
|
|
margin-left: 0.5ch;
|
|
|
|
white-space: nowrap;
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.status-header-action,
|
|
|
|
.status-header-author,
|
|
|
|
.status-header-author:visited,
|
|
|
|
.status-header-author:hover {
|
2018-03-22 21:36:19 -07:00
|
|
|
color: var(--deemphasized-text-color);
|
|
|
|
}
|
|
|
|
|
2018-06-09 15:04:47 -07:00
|
|
|
.status-in-notification .status-header-action,
|
|
|
|
.status-in-notification .status-header-author,
|
|
|
|
.status-in-notification .status-header-author:visited,
|
|
|
|
.status-in-notification .status-header-author:hover {
|
2018-03-22 21:36:19 -07:00
|
|
|
color: var(--body-text-color);
|
|
|
|
}
|
2018-06-09 15:04:47 -07:00
|
|
|
|
|
|
|
@media (max-width: 767px) {
|
2019-03-02 19:02:06 -08:00
|
|
|
:global(.status-header-svg) {
|
2018-06-09 15:04:47 -07:00
|
|
|
margin-left: 10px;
|
|
|
|
}
|
|
|
|
}
|
2019-09-21 13:45:48 -07:00
|
|
|
|
|
|
|
@media (max-width: 240px) {
|
|
|
|
.status-header {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
|
|
|
.status-header-avatar {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
|
|
|
}
|
2018-02-04 10:05:01 -08:00
|
|
|
</style>
|
|
|
|
<script>
|
2018-03-22 21:36:19 -07:00
|
|
|
import Avatar from '../Avatar.html'
|
2018-08-19 15:23:40 -07:00
|
|
|
import AccountDisplayName from '../profile/AccountDisplayName.html'
|
2019-03-02 19:02:06 -08:00
|
|
|
import SvgIcon from '../SvgIcon.html'
|
2019-05-26 09:54:35 -07:00
|
|
|
import { store } from '../../_store/store'
|
2018-03-22 21:36:19 -07:00
|
|
|
|
2018-02-04 10:05:01 -08:00
|
|
|
export default {
|
2018-03-22 21:36:19 -07:00
|
|
|
components: {
|
2018-08-19 15:23:40 -07:00
|
|
|
Avatar,
|
2019-03-02 19:02:06 -08:00
|
|
|
AccountDisplayName,
|
|
|
|
SvgIcon
|
2018-03-22 21:36:19 -07:00
|
|
|
},
|
2019-05-26 09:54:35 -07:00
|
|
|
store: () => store,
|
2018-02-10 13:57:04 -08:00
|
|
|
computed: {
|
2019-02-23 12:32:00 -08:00
|
|
|
elementId: ({ uuid }) => `status-header-${uuid}`,
|
2019-05-26 09:54:35 -07:00
|
|
|
notificationType: ({ notification }) => notification && notification.type,
|
|
|
|
icon: ({ notificationType, status, timelineType }) => {
|
2018-02-11 10:35:25 -08:00
|
|
|
if (timelineType === 'pinned') {
|
|
|
|
return '#fa-thumb-tack'
|
2019-05-26 09:54:35 -07:00
|
|
|
} else if ((notificationType === 'reblog') || (status && status.reblog)) {
|
2018-02-04 10:05:01 -08:00
|
|
|
return '#fa-retweet'
|
2019-05-26 09:54:35 -07:00
|
|
|
} else if (notificationType === 'follow') {
|
2018-02-04 10:05:01 -08:00
|
|
|
return '#fa-user-plus'
|
2019-05-26 09:54:35 -07:00
|
|
|
} else if (notificationType === 'poll') {
|
|
|
|
return '#fa-bar-chart'
|
2018-02-04 10:05:01 -08:00
|
|
|
}
|
|
|
|
return '#fa-star'
|
2019-05-26 09:54:35 -07:00
|
|
|
},
|
|
|
|
actionText: ({ notificationType, status, $currentVerifyCredentials }) => {
|
|
|
|
if (notificationType === 'reblog') {
|
|
|
|
return 'boosted your status'
|
|
|
|
} else if (notificationType === 'favourite') {
|
|
|
|
return 'favorited your status'
|
|
|
|
} else if (notificationType === 'follow') {
|
|
|
|
return 'followed you'
|
|
|
|
} else if (notificationType === 'poll') {
|
|
|
|
if ($currentVerifyCredentials && status && $currentVerifyCredentials.id === status.account.id) {
|
|
|
|
return 'A poll you created has ended'
|
|
|
|
} else {
|
|
|
|
return 'A poll you voted on has ended'
|
|
|
|
}
|
|
|
|
} else if (status && status.reblog) {
|
|
|
|
return 'boosted'
|
|
|
|
} else {
|
|
|
|
return ''
|
|
|
|
}
|
2018-02-04 10:05:01 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-02-13 18:40:02 -08:00
|
|
|
</script>
|