pinafore/routes/_components/status/StatusHeader.html

91 lines
2.3 KiB
HTML
Raw Normal View History

2018-02-04 21:49:42 +01:00
<div class="status-header {{isStatusInNotification ? 'status-in-notification' : ''}}">
2018-02-04 19:05:01 +01:00
<svg>
2018-02-11 19:35:25 +01:00
<use xlink:href="{{icon}}"/>
2018-02-04 19:05:01 +01:00
</svg>
<span>
2018-02-11 19:35:25 +01:00
{{#if timelineType === 'pinned'}}
Pinned toot
{{else}}
<a href="/accounts/{{account.id}}"
focus-key="{{focusKey}}" >
{{account.display_name || ('@' + account.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}}
2018-02-04 19:05:01 +01:00
{{/if}}
</span>
</div>
<style>
.status-header span {
margin-left: 5px;
2018-02-10 07:01:44 +01:00
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
2018-02-04 19:05:01 +01:00
}
2018-02-04 21:49:42 +01:00
:global(
.status-header span,
.status-header a,
.status-header a:visited,
.status-header a:hover
) {
2018-02-04 19:05:01 +01:00
color: var(--deemphasized-text-color);
}
2018-02-04 21:49:42 +01: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 19:05:01 +01:00
.status-header {
2018-02-10 05:07:48 +01:00
grid-area: header;
2018-02-04 19:05:01 +01: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 21:49:42 +01:00
.status-header.status-in-notification svg {
fill: var(--body-text-color);
}
2018-02-04 19:05:01 +01:00
</style>
<script>
export default {
computed: {
statusId: (status) => status.id,
2018-02-11 19:35:25 +01:00
focusKey: (statusId) => `status-header-${statusId}`,
icon: (notification, status, timelineType) => {
if (timelineType === 'pinned') {
return '#fa-thumb-tack'
} else if ((notification && notification.type === 'reblog') || (status && status.reblog)) {
2018-02-04 19:05:01 +01:00
return '#fa-retweet'
} else if (notification && notification.type === 'follow') {
return '#fa-user-plus'
}
return '#fa-star'
},
2018-02-11 19:35:25 +01:00
account: (notification, status) => {
2018-02-04 19:05:01 +01:00
if (notification && notification.account) {
return notification.account
}
return status.account
}
}
}
</script>