From f9c6e94dcfcd8d99732f9522c117e6c87f698685 Mon Sep 17 00:00:00 2001 From: Olaf Sulich Date: Tue, 17 Dec 2024 12:44:40 +0100 Subject: [PATCH] fix: restore avatar only on text value + fix styles --- src/script/components/InputBar/InputBar.tsx | 24 +++++--- .../RichTextEditor/RichTextEditor.tsx | 6 +- .../FormatToolbar/FormatToolbar.styles.ts | 2 - .../SendMessageButton/SendMessageButton.tsx | 5 +- src/style/content/conversation/input-bar.less | 56 ++++++++++++++----- 5 files changed, 66 insertions(+), 27 deletions(-) diff --git a/src/script/components/InputBar/InputBar.tsx b/src/script/components/InputBar/InputBar.tsx index ecd73797558..f56988e9294 100644 --- a/src/script/components/InputBar/InputBar.tsx +++ b/src/script/components/InputBar/InputBar.tsx @@ -562,7 +562,7 @@ export const InputBar = ({ const enableSending = textValue.length > 0; - const showAvatar = messageFormatButtonsEnabled || !!textValue.length; + const showAvatar = !!textValue.length; return (
@@ -627,14 +627,20 @@ export const InputBar = ({ onSend={handleSendMessage} onBlur={() => isTypingRef.current && conversationRepository.sendTypingStop(conversation)} > - +
+
    + +
+ +
)} diff --git a/src/script/components/RichTextEditor/RichTextEditor.tsx b/src/script/components/RichTextEditor/RichTextEditor.tsx index 42ab85ff087..81e2fd30395 100644 --- a/src/script/components/RichTextEditor/RichTextEditor.tsx +++ b/src/script/components/RichTextEditor/RichTextEditor.tsx @@ -251,7 +251,11 @@ export const RichTextEditor = ({ />
- {showFormatToolbar && } + {showFormatToolbar && ( +
+ +
+ )} {children} ); diff --git a/src/script/components/RichTextEditor/components/FormatToolbar/FormatToolbar.styles.ts b/src/script/components/RichTextEditor/components/FormatToolbar/FormatToolbar.styles.ts index d090a351563..686272aaec4 100644 --- a/src/script/components/RichTextEditor/components/FormatToolbar/FormatToolbar.styles.ts +++ b/src/script/components/RichTextEditor/components/FormatToolbar/FormatToolbar.styles.ts @@ -22,6 +22,4 @@ import {CSSObject} from '@emotion/react'; export const wrapperStyles: CSSObject = { display: 'flex', alignItems: 'center', - margin: '8px 0 8px auto', - gridArea: 'toolbar', }; diff --git a/src/script/components/RichTextEditor/components/SendMessageButton/SendMessageButton.tsx b/src/script/components/RichTextEditor/components/SendMessageButton/SendMessageButton.tsx index c4b3776e5ec..62293db3082 100644 --- a/src/script/components/RichTextEditor/components/SendMessageButton/SendMessageButton.tsx +++ b/src/script/components/RichTextEditor/components/SendMessageButton/SendMessageButton.tsx @@ -25,13 +25,14 @@ import {t} from 'Util/LocalizerUtil'; interface SendMessageButtonProps { disabled?: boolean; onSend: () => void; + className?: string; } -export const SendMessageButton = ({disabled, onSend}: SendMessageButtonProps) => { +export const SendMessageButton = ({disabled, onSend, className}: SendMessageButtonProps) => { return (