Skip to content

Commit 5148ee4

Browse files
committed
Show signed-out empty comment state
1 parent cd99ed6 commit 5148ee4

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

components/CommentsSection.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,6 +1606,8 @@ export default function CommentsSection({
16061606
COMMENTS_PAGE_SIZE,
16071607
),
16081608
);
1609+
const showSignedOutEmptyState =
1610+
!authLoading && !user && !error && displayComments.length === 0;
16091611

16101612
return (
16111613
<section
@@ -1910,7 +1912,7 @@ export default function CommentsSection({
19101912
</form>
19111913
) : null}
19121914

1913-
{loading ? (
1915+
{loading && !showSignedOutEmptyState ? (
19141916
<div
19151917
aria-label="Loading comments"
19161918
className="flex animate-pulse gap-4 border-b border-white/20 py-7"
@@ -1923,9 +1925,11 @@ export default function CommentsSection({
19231925
</div>
19241926
) : null}
19251927

1926-
{!loading && !error && displayComments.length === 0 ? (
1928+
{(!loading || showSignedOutEmptyState) &&
1929+
!error &&
1930+
displayComments.length === 0 ? (
19271931
<p className="border-b border-white/30 py-8 text-white/50">
1928-
Be the first to comment.
1932+
No comments yet.
19291933
</p>
19301934
) : null}
19311935

0 commit comments

Comments
 (0)