From 7cfd944abf77eea281bb37f16b963555693c9c4f Mon Sep 17 00:00:00 2001 From: en Date: Tue, 25 Feb 2025 12:28:11 +0100 Subject: [PATCH] fix(popup): show empty message --- src/components/comment/CommentsPopup.tsx | 34 +++++++++++++++++------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/src/components/comment/CommentsPopup.tsx b/src/components/comment/CommentsPopup.tsx index 6af8697..014a1bf 100644 --- a/src/components/comment/CommentsPopup.tsx +++ b/src/components/comment/CommentsPopup.tsx @@ -451,7 +451,7 @@ export const CommentsPopup = ({ title }: CommentsPopupProps) => { - {commentEvents.length > 0 && ( + {commentEvents.length + quoteRepostEvents.length > 0 && ( <>

{isNote ? ( @@ -504,15 +504,29 @@ export const CommentsPopup = ({ title }: CommentsPopupProps) => {

-
- {showQuoteReposts - ? quoteRepostEvents.map((reply) => ( - - )) - : commentEvents.map((reply) => ( - - ))} -
+ {(showQuoteReposts + ? quoteRepostEvents.length + : commentEvents.length) === 0 && !isLoading ? ( +
+

+ There are no{' '} + {showQuoteReposts ? 'quote-reposts' : 'replies'} to show +

+
+ ) : ( +
+ {showQuoteReposts + ? quoteRepostEvents.map((reply) => ( + + )) + : commentEvents.map((reply) => ( + + ))} +
+ )} )}