pinafore/routes/_components/status/StatusHeader.html

88 lines
2.2 KiB
HTML
Raw Normal View History

2018-02-04 20:49:42 +00:00
<div class="status-header {{isStatusInNotification ? 'status-in-notification' : ''}}">
2018-02-04 18:05:01 +00:00
<svg>
<use xlink:href="{{getIcon(notification, status)}}"/>
</svg>
<span>
<a href="/accounts/{{getAccount(notification, status).id}}"
focus-key="{{focusKey}}"
>
2018-02-04 18:05:01 +00:00
{{getAccount(notification, status).display_name || ('@' + getAccount(notification, status).username)}}
</a>
{{#if notification && notification.type === 'reblog'}}
boosted your status
{{elseif notification && notification.type === 'favourite'}}
favorited your status
{{elseif notification && notification.type === 'follow'}}
followed you
{{elseif status && status.reblog}}
boosted
{{/if}}
</span>
</div>
<style>
.status-header span {
margin-left: 5px;
2018-02-10 06:01:44 +00:00
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
2018-02-04 18:05:01 +00:00
}
2018-02-04 20:49:42 +00:00
:global(
.status-header span,
.status-header a,
.status-header a:visited,
.status-header a:hover
) {
2018-02-04 18:05:01 +00:00
color: var(--deemphasized-text-color);
}
2018-02-04 20:49:42 +00:00
:global(
.status-header.status-in-notification span,
.status-header.status-in-notification a,
.status-header.status-in-notification a:visited,
.status-header.status-in-notification a:hover
) {
color: var(--body-text-color);
}
2018-02-04 18:05:01 +00:00
.status-header {
2018-02-10 04:07:48 +00:00
grid-area: header;
2018-02-04 18:05:01 +00:00
margin: 5px 10px 5px 5px;
display: flex;
align-items: center;
}
.status-header svg {
width: 18px;
height: 18px;
fill: var(--deemphasized-text-color);
}
2018-02-04 20:49:42 +00:00
.status-header.status-in-notification svg {
fill: var(--body-text-color);
}
2018-02-04 18:05:01 +00:00
</style>
<script>
export default {
computed: {
statusId: (status) => status.id,
focusKey: (statusId) => `status-header-${statusId}`
},
2018-02-04 18:05:01 +00:00
helpers: {
getIcon(notification, status) {
if ((notification && notification.type === 'reblog') || (status && status.reblog)) {
return '#fa-retweet'
} else if (notification && notification.type === 'follow') {
return '#fa-user-plus'
}
return '#fa-star'
},
getAccount(notification, status) {
if (notification && notification.account) {
return notification.account
}
return status.account
}
}
}
</script>