Fixed comments on the feed page

This commit is contained in:
kvakazyambra 2023-03-01 20:53:23 +03:00
parent 79870a4b99
commit a036299887
3 changed files with 25 additions and 4 deletions

View File

@ -1,9 +1,14 @@
.sidebar {
max-height: calc(100vh - 120px);
overflow: auto;
padding-right: 1rem;
overflow: hidden;
padding-right: 2.6rem;
position: sticky;
top: 120px;
&:hover {
overflow: scroll;
padding-right: 1rem;
}
}
.counter {

View File

@ -521,6 +521,6 @@
&,
a::before {
border-radius: 1.2em;
border-radius: 1.2em !important;
}
}

View File

@ -20,6 +20,7 @@ import type { Reaction } from '../../graphql/types.gen'
import { getPagePath } from '@nanostores/router'
import { router } from '../../stores/router'
import { useLocalize } from '../../context/localize'
import type { Author } from '../../graphql/types.gen'
export const FEED_PAGE_SIZE = 20
@ -142,7 +143,22 @@ export const FeedView = () => {
<section class={styles.asideSection}>
<h4>{t('Comments')}</h4>
<For each={topComments()}>
{(comment) => <CommentCard comment={comment} compact={true} />}
{(comment) => {
return (
<div class={styles.comment}>
<div class={clsx('text-truncate', styles.commentBody)} innerHTML={comment.body} />
<AuthorCard
author={comment.createdBy as Author}
isFeedMode={true}
compact={true}
hideFollow={true}
/>
<div class={clsx('text-truncate', styles.commentArticleTitle)}>
<a href={`/${comment.shout.slug}`}>{comment.shout.title}</a>
</div>
</div>
)
}}
</For>
</section>