From 038285ffc6433e45b2a275482901b560ca432e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Sat, 7 Mar 2026 00:21:45 +0100 Subject: [PATCH] nicolium: simplify, fix not showing chat list when shoutbox should be visible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- .../chats/components/chat-pane/blankslate.tsx | 41 ++++++++--------- .../components/blankslate-empty.tsx | 45 ++++++++----------- .../components/chats-page-empty.tsx | 4 +- 3 files changed, 40 insertions(+), 50 deletions(-) diff --git a/packages/nicolium/src/features/chats/components/chat-pane/blankslate.tsx b/packages/nicolium/src/features/chats/components/chat-pane/blankslate.tsx index b2e3c35ef..5d161b3d3 100644 --- a/packages/nicolium/src/features/chats/components/chat-pane/blankslate.tsx +++ b/packages/nicolium/src/features/chats/components/chat-pane/blankslate.tsx @@ -1,32 +1,29 @@ import React from 'react'; -import { defineMessages, useIntl } from 'react-intl'; - -const messages = defineMessages({ - title: { id: 'chat_pane.blankslate.title', defaultMessage: 'No messages yet' }, - body: { id: 'chat_pane.blankslate.body', defaultMessage: 'Search for someone to chat with.' }, - action: { id: 'chat_pane.blankslate.action', defaultMessage: 'Message someone' }, -}); +import { FormattedMessage } from 'react-intl'; interface IBlankslate { onSearch(): void; } -const Blankslate = ({ onSearch }: IBlankslate) => { - const intl = useIntl(); +const Blankslate = ({ onSearch }: IBlankslate) => ( +
+
+

+ +

- return ( -
-
-

- {intl.formatMessage(messages.title)} -

- -

{intl.formatMessage(messages.body)}

-
- - +

+ +

- ); -}; + + +
+); export { Blankslate as default }; diff --git a/packages/nicolium/src/features/chats/components/chats-page/components/blankslate-empty.tsx b/packages/nicolium/src/features/chats/components/chats-page/components/blankslate-empty.tsx index 5ab5f6b51..91a1cf91e 100644 --- a/packages/nicolium/src/features/chats/components/chats-page/components/blankslate-empty.tsx +++ b/packages/nicolium/src/features/chats/components/chats-page/components/blankslate-empty.tsx @@ -1,4 +1,3 @@ -import { useNavigate } from '@tanstack/react-router'; import React from 'react'; import { FormattedMessage } from 'react-intl'; @@ -7,33 +6,25 @@ import Stack from '@/components/ui/stack'; import Text from '@/components/ui/text'; /** To display on the chats main page when no message is selected. */ -const BlankslateEmpty: React.FC = () => { - const navigate = useNavigate(); +const BlankslateEmpty: React.FC = () => ( + + + + + - const handleNewChat = () => { - navigate({ to: '/chats/new' }); - }; - - return ( - - - - - - - - - - - - + + + - ); -}; + + + +); export { BlankslateEmpty as default }; diff --git a/packages/nicolium/src/features/chats/components/chats-page/components/chats-page-empty.tsx b/packages/nicolium/src/features/chats/components/chats-page/components/chats-page-empty.tsx index c743cba80..482b79fee 100644 --- a/packages/nicolium/src/features/chats/components/chats-page/components/chats-page-empty.tsx +++ b/packages/nicolium/src/features/chats/components/chats-page/components/chats-page-empty.tsx @@ -1,11 +1,13 @@ import React from 'react'; import { useChats } from '@/queries/chats'; +import { useShoutboxIsLoading } from '@/stores/shoutbox'; import BlankslateEmpty from './blankslate-empty'; import BlankslateWithChats from './blankslate-with-chats'; const ChatsPageEmpty = () => { + const showShoutbox = !useShoutboxIsLoading(); const { chatsQuery: { data: chats, isLoading }, } = useChats(); @@ -14,7 +16,7 @@ const ChatsPageEmpty = () => { return null; } - if (chats && chats.length > 0) { + if ((chats && chats.length > 0) || showShoutbox) { return ; }