From df9472d04cb99e2dbaab3d19384d8cd2e7a06c97 Mon Sep 17 00:00:00 2001 From: ajaythapliyal Date: Sun, 26 Feb 2023 08:49:53 +0530 Subject: [PATCH 1/3] increases line height to center the text in input --- frontend/src/conversation/Conversation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 3dc49f3..9a30c4a 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -48,7 +48,7 @@ export default function Conversation() {
{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); From 2348848c18b7e88b9aa77388ebf1eeeed9b2d4cc Mon Sep 17 00:00:00 2001 From: ajaythapliyal Date: Sun, 26 Feb 2023 17:19:35 +0530 Subject: [PATCH 2/3] this fixes 5 from nick's list --- frontend/src/conversation/Conversation.tsx | 70 +++++++++++----------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 9a30c4a..89ce3b9 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -44,43 +44,45 @@ export default function Conversation() { })} {messages.length === 0 && }
-
-
{ - if (e.key === 'Enter' && !e.shiftKey) { - e.preventDefault(); - if (inputRef.current?.textContent && status !== 'loading') { - handleQuestion(inputRef.current.textContent); - inputRef.current.textContent = ''; - } - } - }} - >
- {status === 'loading' ? ( - - ) : ( - { - if (inputRef.current?.textContent) { - handleQuestion(inputRef.current.textContent); - inputRef.current.textContent = ''; +
+
+
{ + if (e.key === 'Enter' && !e.shiftKey) { + e.preventDefault(); + if (inputRef.current?.textContent && status !== 'loading') { + handleQuestion(inputRef.current.textContent); + inputRef.current.textContent = ''; + } } }} - src={Send} - className="relative right-9 cursor-pointer" - > - )} + >
+ {status === 'loading' ? ( + + ) : ( + { + if (inputRef.current?.textContent) { + handleQuestion(inputRef.current.textContent); + inputRef.current.textContent = ''; + } + }} + src={Send} + className="relative right-[35px] bottom-[15px] -mr-[21px] cursor-pointer self-end" + > + )} +
+

+ This is a chatbot that uses the GPT-3, Faiss and LangChain to answer + questions. +

-

- This is a chatbot that uses the GPT-3, Faiss and LangChain to answer - questions. -

); } From b4a4007f6640e11d49ce0761f2753df50ee93fc1 Mon Sep 17 00:00:00 2001 From: ajaythapliyal Date: Sun, 26 Feb 2023 20:04:55 +0530 Subject: [PATCH 3/3] word wrap fix --- frontend/src/conversation/Conversation.tsx | 2 +- frontend/src/conversation/ConversationBubble.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 89ce3b9..2102ec2 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -49,7 +49,7 @@ export default function Conversation() {
{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 9a1fd43..1573a92 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -35,7 +35,7 @@ const ConversationBubble = forwardRef< {type === 'ERROR' && ( alert )} -

{message}

+

{message}

);