From dcb2810d4692d14d7995672f42f7673d4e0abb66 Mon Sep 17 00:00:00 2001 From: Shemar Lindie Date: Wed, 19 Apr 2023 10:34:27 -0400 Subject: [PATCH] fix: optimize mobile layout (#606) - conserve space in new convo view - fix overlapping edit and delete chat message icons - fix overlapping copy icon --- components/Chat/Chat.tsx | 2 +- components/Chat/ChatMessage.tsx | 70 +++++++++++++-------------------- 2 files changed, 28 insertions(+), 44 deletions(-) diff --git a/components/Chat/Chat.tsx b/components/Chat/Chat.tsx index 5d1148c..815bde1 100644 --- a/components/Chat/Chat.tsx +++ b/components/Chat/Chat.tsx @@ -398,7 +398,7 @@ export const Chat = memo(({ stopConversationRef }: Props) => { > {selectedConversation?.messages.length === 0 ? ( <> -
+
{models.length === 0 ? (
diff --git a/components/Chat/ChatMessage.tsx b/components/Chat/ChatMessage.tsx index 9c2cdb9..aa0f488 100644 --- a/components/Chat/ChatMessage.tsx +++ b/components/Chat/ChatMessage.tsx @@ -126,14 +126,14 @@ export const ChatMessage: FC = memo(({ message, messageIndex, onEdit }) = return (
-
+
{message.role === 'assistant' ? ( @@ -185,64 +185,32 @@ export const ChatMessage: FC = memo(({ message, messageIndex, onEdit }) =
) : ( -
+
{message.content}
)} - {(window.innerWidth < 640 || !isEditing) && ( - <> + {!isEditing && ( +
- +
)}
) : ( - <> -
- {messagedCopied ? ( - - ) : ( - - )} -
- +
= memo(({ message, messageIndex, onEdit }) = > {message.content} - + +
+ {messagedCopied ? ( + + ) : ( + + )} +
+
)}