Refactor: New Post design

This commit is contained in:
Donatas Kirda 2024-05-14 12:30:57 +03:00
parent 1286de4c64
commit a63034b4b4
Signed by: bloodwiing
GPG Key ID: 63020D8D3F4A164F
2 changed files with 32 additions and 9 deletions

View File

@ -35,17 +35,24 @@
gap: 16px
}
.postHead {
.titleBar {
display: flex;
flex-flow: column nowrap;
gap: 8px;
align-items: center;
align-items: start;
justify-content: center;
flex: 1;
& > .date {
color: var(--white-dim);
}
}
.postHead {
display: flex;
flex-flow: row nowrap;
gap: 16px;
}
.commentsPart {
display: flex;
flex-flow: column nowrap;
@ -54,18 +61,32 @@
.commentsHead {
width: 100%;
border-bottom: 2px solid var(--accent-dim);
border-bottom: 1px solid var(--accent-dim);
margin-top: 32px;
}
.postInfo {
display: flex;
flex-flow: row nowrap;
gap: 12px;
align-items: start;
justify-content: space-between;
width: 100%;
}
</style>
<div class="body">
<article class="post">
<div class="postHead">
<UserItem user={post.author} iconSize={28}></UserItem>
<Avatar size={64}></Avatar>
<div class="titleBar">
<div class="postInfo">
<Mention user={post.author}></Mention>
<Ago date={post.postDate}></Ago>
</div>
<h1 class="typeTitle">{post.name}</h1>
<span class="date">{moment(post.postDate).fromNow()}</span>
</div>
</div>
<p class="postContent">
@ -77,11 +98,11 @@
{#if commentTree}
<div class="commentsPart">
<h3 class="commentsHead typeName">Comments</h3>
<div class="commentsHead"></div>
<CommentList commentTreeList={commentTree} getTags={(comment) => {
if (comment.author?.id == post.author?.id) {
return ["OP 🖋️"];
return ["Original 🖋️"];
}
return [];
}}></CommentList>

View File

@ -9,6 +9,8 @@
--white: #ffffff;
--white-dim: #afbcc2;
--gray: #1d1d28;
}
body {