From 35f55fcabbedf14726886286e0730f9e023ec3d5 Mon Sep 17 00:00:00 2001 From: ap-atul Date: Mon, 17 Apr 2023 23:54:28 +0530 Subject: [PATCH 1/2] removed send button | minor bug fix --- .../sections/ThreadSection/ThreadSection.tsx | 50 +++++++------------ 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/apps/web/src/sections/ThreadSection/ThreadSection.tsx b/apps/web/src/sections/ThreadSection/ThreadSection.tsx index 863a92b7..107b5dd5 100644 --- a/apps/web/src/sections/ThreadSection/ThreadSection.tsx +++ b/apps/web/src/sections/ThreadSection/ThreadSection.tsx @@ -11,16 +11,6 @@ import {Loader} from "../../components/Loader"; import {LoadMore} from "../../components/Button/LoadMore"; import {get, has, isNil} from "lodash"; -const SendIcon = () => { - return ( - - ); -} - export const ThreadSection = (props: ThreadSectionProps) => { const threadId = props.threadId; const user = useAppSelector((state) => state.user); @@ -57,13 +47,14 @@ export const ThreadSection = (props: ThreadSectionProps) => { return ; } + const setOrResetChatBoxHeight = (height: string = "20px") => { + if (commentBoxRef.current) { + commentBoxRef.current.style.height = height; + } + } + const handleOnSend = () => { - handleOnCommentSubmit().finally(() => { - // setting default height for comment box - if (commentBoxRef.current) { - commentBoxRef.current.style.height = `20px`; - } - }); + handleOnCommentSubmit().then(() => setOrResetChatBoxHeight()); } const handleOnCommentSubmit = async () => { @@ -81,7 +72,7 @@ export const ThreadSection = (props: ThreadSectionProps) => { session: user.didSession, threadId: threadId, userId: user.id, - comment: comment, + comment: comment.trim(), createdFrom: constants.CREATED_FROM_DEVNODE, createdAt: new Date().toISOString() }).finally(() => setIsCommenting(false)); @@ -156,23 +147,24 @@ export const ThreadSection = (props: ThreadSectionProps) => {
-
+