feat(post page): add error line above post

This commit is contained in:
Tom (plebeius.eth)
2024-07-07 19:12:12 +02:00
parent e716a45a31
commit a2347769e2
2 changed files with 15 additions and 1 deletions
+11
View File
@@ -3,6 +3,12 @@
overflow-x: hidden;
}
.error {
color: red;
padding: 5px;
display: block;
}
.thread {
clear: both;
}
@@ -508,6 +514,11 @@
}
@media (min-width: 640px) {
.error {
padding-left: 0;
padding-bottom: 0;
}
.replyQuotePreview {
padding-right: 7px;
padding-left: 2px;
+4 -1
View File
@@ -75,7 +75,7 @@ const PostPage = () => {
post = comment;
}
const { deleted, locked, removed } = post || {};
const { error, deleted, locked, removed, replyCount } = post || {};
const isThreadClosed = deleted || locked || removed;
useEffect(() => {
@@ -92,6 +92,9 @@ const PostPage = () => {
<div className={styles.content}>
{isInSettigsView && <SettingsModal />}
{showReplyModal && activeCid && <ReplyModal closeModal={closeModal} parentCid={activeCid} scrollY={scrollY} />}
{/* TODO: remove this replyCount error once api supports scrolling replies pages */}
{replyCount > 60 && <span className={styles.error}>Error: this thread has too many replies, some of them cannot be displayed right now.</span>}
{error && <span className={styles.error}>Error: {error.message}</span>}
{isInDescriptionView ? (
<SubplebbitDescription
avatarUrl={suggested?.avatarUrl}