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

View File

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