From 6c7609c5739d3513912a102d481cb5934d1a03b6 Mon Sep 17 00:00:00 2001 From: PhilReact Date: Tue, 3 Dec 2024 14:01:07 +0200 Subject: [PATCH] move send btn to the side, changed add group label --- src/components/Chat/ChatDirect.tsx | 39 +++++++++--------------------- src/components/Chat/ChatGroup.tsx | 37 ++++++++-------------------- src/components/Group/AddGroup.tsx | 2 +- src/components/Group/Group.tsx | 2 +- 4 files changed, 24 insertions(+), 56 deletions(-) diff --git a/src/components/Chat/ChatDirect.tsx b/src/components/Chat/ChatDirect.tsx index cbd5b6e..cb40066 100644 --- a/src/components/Chat/ChatDirect.tsx +++ b/src/components/Chat/ChatDirect.tsx @@ -580,7 +580,7 @@ useEffect(() => { backgroundColor: "#232428", minHeight: isMobile ? '0px' : '150px', display: 'flex', - flexDirection: 'column', + flexDirection: 'row', overflow: 'hidden', width: '100%', boxSizing: 'border-box', @@ -596,14 +596,17 @@ useEffect(() => { flexDirection: 'column', flexGrow: isMobile && 1, overflow: !isMobile && "auto", - flexShrink: 0 + flexShrink: 0, + width: 'calc(100% - 100px)', + justifyContent: 'flex-end' }}> {replyMessage && ( @@ -660,34 +663,14 @@ useEffect(() => { )} - {isFocusedParent && ( - { - if(isSending) return - setIsFocusedParent(false) - clearEditorContent() - // Unfocus the editor - }} - style={{ - marginTop: 'auto', - alignSelf: 'center', - cursor: isSending ? 'default' : 'pointer', - background: 'red', - flexShrink: 0, - padding: isMobile && '5px' - }} - > - - {` Close`} - - - )} + { if(messageSize > 4000) return @@ -701,7 +684,9 @@ useEffect(() => { cursor: isSending ? 'default' : 'pointer', background: isSending && 'rgba(0, 0, 0, 0.8)', flexShrink: 0, - padding: isMobile && '5px' + padding: '5px', + width: '100px', + minWidth: 'auto' }} > {isSending && ( diff --git a/src/components/Chat/ChatGroup.tsx b/src/components/Chat/ChatGroup.tsx index 4ff4f94..b7e15d8 100644 --- a/src/components/Chat/ChatGroup.tsx +++ b/src/components/Chat/ChatGroup.tsx @@ -755,7 +755,7 @@ const clearEditorContent = () => { backgroundColor: "#232428", minHeight: isMobile ? '0px' : '150px', display: 'flex', - flexDirection: 'column', + flexDirection: 'row', overflow: 'hidden', width: '100%', boxSizing: 'border-box', @@ -766,12 +766,15 @@ const clearEditorContent = () => { zIndex: isFocusedParent ? 5 : 'unset', flexShrink: 0 }}> +
{replyMessage && ( { )} - {isFocusedParent && ( - { - if(isSending) return - setIsFocusedParent(false) - clearEditorContent() - // Unfocus the editor - }} - style={{ - marginTop: 'auto', - alignSelf: 'center', - cursor: isSending ? 'default' : 'pointer', - background: 'red', - flexShrink: 0, - padding: isMobile && '5px' - }} - > - - {` Close`} - - - )} + { if(messageSize > 4000) return @@ -877,7 +859,9 @@ const clearEditorContent = () => { cursor: isSending ? 'default' : 'pointer', background: isSending && 'rgba(0, 0, 0, 0.8)', flexShrink: 0, - padding: isMobile && '5px', + padding: '5px', + width: '100px', + minWidth: 'auto' }} > @@ -898,7 +882,6 @@ const clearEditorContent = () => { - {/* */}
)} {isOpenQManager !== null && ( diff --git a/src/components/Group/AddGroup.tsx b/src/components/Group/AddGroup.tsx index f4c6e6d..ed90c8c 100644 --- a/src/components/Group/AddGroup.tsx +++ b/src/components/Group/AddGroup.tsx @@ -194,7 +194,7 @@ export const AddGroup = ({ address, open, setOpen }) => { - Add Group + Group Mgmt - Add Group + Group Mgmt
)} {chatMode === "directs" && (