From 4b69f99d0a7dee536473fc7357af25c1b9b9f1d6 Mon Sep 17 00:00:00 2001 From: FanisNgv Date: Thu, 12 Sep 2024 14:31:00 +0300 Subject: [PATCH 1/2] empty messages problem solved --- frontend/src/app/components/MessageList.tsx | 30 +++++++++++---------- frontend/src/app/page.tsx | 2 +- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/frontend/src/app/components/MessageList.tsx b/frontend/src/app/components/MessageList.tsx index 99f9dcc..466e09d 100644 --- a/frontend/src/app/components/MessageList.tsx +++ b/frontend/src/app/components/MessageList.tsx @@ -17,20 +17,22 @@ export default function MessageList({ messages }: MessageListProps) { {messages.map((msg) => ( - -
- {msg.text} -
-
+ msg.text && ( + +
+ {msg.text} +
+
+ ) ))}
diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index 0472e35..13467ed 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -27,5 +27,5 @@ export default function Home() { redirectToConversation(); }, [router, config.ENDPOINT]); - return null; // или можно вернуть компонент загрузки + return null; } \ No newline at end of file From 45c62ae150b6528507cf5b47d8be7d39a11f20a5 Mon Sep 17 00:00:00 2001 From: FanisNgv Date: Thu, 12 Sep 2024 15:47:14 +0300 Subject: [PATCH 2/2] adaptive main page --- frontend/src/app/conversations/[id]/page.tsx | 42 ++++++++++++-------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/frontend/src/app/conversations/[id]/page.tsx b/frontend/src/app/conversations/[id]/page.tsx index 6712d0f..1ace06e 100644 --- a/frontend/src/app/conversations/[id]/page.tsx +++ b/frontend/src/app/conversations/[id]/page.tsx @@ -230,21 +230,31 @@ export default function ConversationPage({ params }: { params: { id: string } }) return (
-
- {isSidebarOpen && ( - - )} -
- -
-
+ + + + + + )} + +
+
-
+
-
+