2024-06-17 21:17:27 +01:00
|
|
|
<script>
|
2024-06-28 06:19:00 +01:00
|
|
|
import { parseText as parseEmojis } from '../../emoji.js';
|
|
|
|
import { shorthand as short_time } from '../../time.js';
|
2024-06-17 21:17:27 +01:00
|
|
|
|
|
|
|
export let post;
|
2024-06-28 06:19:00 +01:00
|
|
|
export let reply = undefined;
|
2024-06-17 21:17:27 +01:00
|
|
|
|
|
|
|
let time_string = post.created_at.toLocaleString();
|
|
|
|
</script>
|
|
|
|
|
2024-06-28 06:19:00 +01:00
|
|
|
<div class={"post-header-container" + (reply ? " reply" : "")}>
|
2024-06-21 06:52:34 +01:00
|
|
|
<a href={post.user.url} target="_blank" class="post-avatar-container">
|
2024-06-17 21:17:27 +01:00
|
|
|
<img src={post.user.avatar_url} type={post.user.avatar_type} alt="" width="48" height="48" class="post-avatar" loading="lazy" decoding="async">
|
|
|
|
</a>
|
|
|
|
<header class="post-header">
|
|
|
|
<div class="post-user-info">
|
2024-06-21 06:52:34 +01:00
|
|
|
<a href={post.user.url} target="_blank" class="name">{@html post.user.rich_name}</a>
|
2024-06-17 21:17:27 +01:00
|
|
|
<span class="username">{post.user.mention}</span>
|
|
|
|
</div>
|
|
|
|
<div class="post-info">
|
2024-06-21 06:52:34 +01:00
|
|
|
<a href={post.url} target="_blank" class="created-at">
|
2024-06-17 21:17:27 +01:00
|
|
|
<time title={time_string}>{short_time(post.created_at)}</time>
|
2024-06-21 05:43:23 +01:00
|
|
|
{#if post.visibility !== "public"}
|
2024-06-28 06:19:00 +01:00
|
|
|
<br>
|
|
|
|
<span class="post-visibility">{post.visibility}</span>
|
2024-06-21 05:43:23 +01:00
|
|
|
{/if}
|
2024-06-17 21:17:27 +01:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.post-header-container {
|
2024-06-28 06:19:00 +01:00
|
|
|
width: 100%;
|
2024-06-17 21:17:27 +01:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
}
|
|
|
|
|
2024-06-28 06:19:00 +01:00
|
|
|
.post-header-container.reply {
|
|
|
|
width: calc(100% + 60px);
|
|
|
|
margin-left: -60px;
|
|
|
|
}
|
|
|
|
|
2024-06-17 21:17:27 +01:00
|
|
|
.post-header-container a,
|
|
|
|
.post-header-container a:visited {
|
|
|
|
color: inherit;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
.post-header-container a:hover {
|
|
|
|
text-decoration: underline;
|
|
|
|
}
|
|
|
|
|
|
|
|
.post-avatar-container {
|
|
|
|
margin-right: 12px;
|
2024-06-21 06:52:34 +01:00
|
|
|
display: flex;
|
2024-06-17 21:17:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.post-avatar {
|
|
|
|
border-radius: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.post-header {
|
|
|
|
display: flex;
|
|
|
|
flex-grow: 1;
|
|
|
|
flex-direction: row;
|
|
|
|
}
|
|
|
|
|
|
|
|
.post-info {
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
|
|
|
|
2024-06-21 06:52:34 +01:00
|
|
|
.post-user-info {
|
2024-06-21 07:52:54 +01:00
|
|
|
margin-top: -2px;
|
2024-06-21 06:52:34 +01:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
|
2024-06-17 21:17:27 +01:00
|
|
|
.post-user-info a {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.post-user-info .name :global(.emoji) {
|
|
|
|
position: relative;
|
|
|
|
top: 4px;
|
2024-06-21 06:52:34 +01:00
|
|
|
height: 20px;
|
2024-06-17 21:17:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.post-user-info .username {
|
2024-06-28 06:19:00 +01:00
|
|
|
opacity: .8;
|
2024-06-17 21:17:27 +01:00
|
|
|
font-size: .9em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.post-info .created-at {
|
2024-06-28 06:19:00 +01:00
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: end;
|
|
|
|
justify-content: center;
|
2024-06-17 21:17:27 +01:00
|
|
|
font-size: .8em;
|
|
|
|
}
|
2024-06-28 06:19:00 +01:00
|
|
|
|
|
|
|
.post-visibility {
|
|
|
|
font-size: .9em;
|
|
|
|
opacity: .8;
|
|
|
|
}
|
2024-06-17 21:17:27 +01:00
|
|
|
</style>
|