From 8f1cd861151309c84d805e8df7be0081a2a57b14 Mon Sep 17 00:00:00 2001 From: Ana Date: Wed, 23 Jul 2025 15:03:32 -0700 Subject: update: chat request ui --- src/screens/Messages/ChatList.tsx | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/screens/Messages/ChatList.tsx b/src/screens/Messages/ChatList.tsx index e13f0617b..5f06945b1 100644 --- a/src/screens/Messages/ChatList.tsx +++ b/src/screens/Messages/ChatList.tsx @@ -164,12 +164,18 @@ export function MessagesScreenInner({navigation, route}: Props) { // filter out convos that are actively being left .filter(convo => !leftConvos.includes(convo.id)) + const hasInboxRequests = inboxPreviewConvos?.length > 0 + return [ - { - type: 'INBOX', - count: inboxPreviewConvos.length, - profiles: inboxPreviewConvos.slice(0, 3), - }, + ...(hasInboxRequests + ? [ + { + type: 'INBOX' as const, + count: inboxPreviewConvos.length, + profiles: inboxPreviewConvos.slice(0, 3), + }, + ] + : []), ...conversations.map( convo => ({type: 'CONVERSATION', conversation: convo}) as const, ), @@ -223,16 +229,23 @@ export function MessagesScreenInner({navigation, route}: Props) { return listenSoftReset(onSoftReset) }, [onSoftReset, isScreenFocused]) - // Will always have 1 item - the inbox button - if (conversations.length < 2) { + // Show empty state only if there are no conversations at all + const actualConversations = conversations.filter( + item => item.type === 'CONVERSATION', + ) + const hasInboxRequests = inboxPreviewConvos?.length > 0 + + if (actualConversations.length === 0) { return (
- + {hasInboxRequests && ( + + )} {isLoading ? ( ) : ( -- cgit 1.4.1 From a3b188baecc34872e1ccda446d2b7b2f2064f727 Mon Sep 17 00:00:00 2001 From: Ana Date: Wed, 23 Jul 2025 17:21:17 -0700 Subject: update: comment with a name --- src/screens/Messages/ChatList.tsx | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/screens/Messages/ChatList.tsx b/src/screens/Messages/ChatList.tsx index 5f06945b1..c37a025cc 100644 --- a/src/screens/Messages/ChatList.tsx +++ b/src/screens/Messages/ChatList.tsx @@ -229,6 +229,7 @@ export function MessagesScreenInner({navigation, route}: Props) { return listenSoftReset(onSoftReset) }, [onSoftReset, isScreenFocused]) + // NOTE(APiligrim) // Show empty state only if there are no conversations at all const actualConversations = conversations.filter( item => item.type === 'CONVERSATION', -- cgit 1.4.1