2018-02-11 00:31:26 +01:00
|
|
|
<div class="status-details">
|
2018-04-19 08:48:06 +02:00
|
|
|
<ExternalLink className="status-absolute-date"
|
2018-05-02 02:05:36 +02:00
|
|
|
href={originalStatus.url}
|
2018-04-16 01:00:09 +02:00
|
|
|
showIcon="true"
|
2018-05-02 02:05:36 +02:00
|
|
|
ariaLabel="{formattedDate} (opens in new window)"
|
2018-04-16 01:00:09 +02:00
|
|
|
>
|
2018-05-02 02:05:36 +02:00
|
|
|
<time datetime={createdAtDate} title={formattedDate}>{formattedDate}</time>
|
2018-02-11 00:31:26 +01:00
|
|
|
</ExternalLink>
|
2018-03-16 04:04:24 +01:00
|
|
|
<a class="status-favs-reblogs"
|
2018-05-02 02:05:36 +02:00
|
|
|
href="/statuses/{originalStatusId}/reblogs"
|
|
|
|
aria-label={reblogsLabel}>
|
2018-03-16 16:42:10 +01:00
|
|
|
<svg class="status-favs-reblogs-svg">
|
2018-02-11 00:31:26 +01:00
|
|
|
<use xlink:href="#fa-retweet"/>
|
|
|
|
</svg>
|
2018-05-02 02:05:36 +02:00
|
|
|
<span>{numReblogs}</span>
|
2018-02-11 00:31:26 +01:00
|
|
|
</a>
|
2018-03-16 04:04:24 +01:00
|
|
|
<a class="status-favs-reblogs"
|
2018-05-02 02:05:36 +02:00
|
|
|
href="/statuses/{originalStatusId}/favorites"
|
|
|
|
aria-label={favoritesLabel}>
|
2018-03-16 16:42:10 +01:00
|
|
|
<svg class="status-favs-reblogs-svg">
|
2018-02-11 00:31:26 +01:00
|
|
|
<use xlink:href="#fa-star" />
|
|
|
|
</svg>
|
2018-05-02 02:05:36 +02:00
|
|
|
<span>{numFavs}</span>
|
2018-02-11 00:31:26 +01:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<style>
|
|
|
|
.status-details {
|
|
|
|
grid-area: details;
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: minmax(0, max-content) min-content min-content;
|
|
|
|
grid-gap: 20px;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: left;
|
|
|
|
margin: 0 5px 10px;
|
|
|
|
}
|
|
|
|
:global(.status-absolute-date) {
|
|
|
|
font-size: 1.1em;
|
|
|
|
min-width: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.status-absolute-date time) {
|
|
|
|
word-wrap: break-word;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: pre-wrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
.status-favs-reblogs {
|
|
|
|
font-size: 1.1em;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.status-favs-reblogs span {
|
|
|
|
margin-left: 5px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.status-favs-reblogs,
|
|
|
|
.status-favs-reblogs:hover,
|
|
|
|
.status-favs-reblogs:visited {
|
|
|
|
color: var(--deemphasized-text-color);
|
|
|
|
}
|
|
|
|
|
2018-03-16 16:42:10 +01:00
|
|
|
.status-favs-reblogs-svg {
|
2018-02-11 00:31:26 +01:00
|
|
|
fill: var(--deemphasized-text-color);
|
|
|
|
width: 18px;
|
|
|
|
height: 18px;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.status-absolute-date, .status-absolute-date:hover, .status-absolute-date:visited) {
|
|
|
|
color: var(--deemphasized-text-color);
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (max-width: 479px) {
|
|
|
|
:global(.status-absolute-date) {
|
|
|
|
font-size: 1em;
|
|
|
|
}
|
|
|
|
.status-favs-reblogs {
|
|
|
|
font-size: 1em;
|
|
|
|
}
|
|
|
|
.status-details {
|
|
|
|
grid-gap: 5px;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
<script>
|
|
|
|
import ExternalLink from '../ExternalLink.html'
|
|
|
|
|
|
|
|
const formatter = new Intl.DateTimeFormat('en-US', {
|
|
|
|
year: 'numeric',
|
|
|
|
month: 'long',
|
|
|
|
day: 'numeric',
|
|
|
|
hour: '2-digit',
|
|
|
|
minute: '2-digit'
|
|
|
|
})
|
|
|
|
|
|
|
|
export default {
|
|
|
|
computed: {
|
2018-05-02 02:05:36 +02:00
|
|
|
createdAtDate: ({ originalStatus }) => originalStatus.created_at,
|
|
|
|
numReblogs: ({ originalStatus }) => originalStatus.reblogs_count || 0,
|
|
|
|
numFavs: ({ originalStatus }) => originalStatus.favourites_count || 0,
|
|
|
|
formattedDate: ({ createdAtDate }) => formatter.format(new Date(createdAtDate)),
|
|
|
|
reblogsLabel: ({ numReblogs }) => {
|
2018-02-22 03:39:53 +01:00
|
|
|
// TODO: intl
|
|
|
|
return numReblogs === 1
|
|
|
|
? `Boosted ${numReblogs} time`
|
|
|
|
: `Boosted ${numReblogs} times`
|
|
|
|
},
|
2018-05-02 02:05:36 +02:00
|
|
|
favoritesLabel: ({ numFavs }) => {
|
2018-02-22 03:39:53 +01:00
|
|
|
// TODO: intl
|
|
|
|
return numFavs === 1
|
|
|
|
? `Favorited ${numFavs} time`
|
|
|
|
: `Favorited ${numFavs} times`
|
|
|
|
}
|
2018-02-11 00:31:26 +01:00
|
|
|
},
|
|
|
|
components: {
|
|
|
|
ExternalLink
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|