From dcc5405e8a76037763950f2598721a30bb7934aa Mon Sep 17 00:00:00 2001
From: dan <dan.abramov@gmail.com>
Date: Mon, 28 Oct 2024 19:12:15 +0000
Subject: Make composer min height conditional and align attachments (#5976)

* Make web composer min height condiitonal

* Fix alignment

* Fix alignment on mobile
---
 src/view/com/composer/text-input/TextInput.web.tsx | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'src/view/com/composer/text-input/TextInput.web.tsx')

diff --git a/src/view/com/composer/text-input/TextInput.web.tsx b/src/view/com/composer/text-input/TextInput.web.tsx
index 1d7908e16..9da220c1b 100644
--- a/src/view/com/composer/text-input/TextInput.web.tsx
+++ b/src/view/com/composer/text-input/TextInput.web.tsx
@@ -41,6 +41,7 @@ interface TextInputProps {
   richtext: RichText
   placeholder: string
   suggestedLinks: Set<string>
+  webForceMinHeight: boolean
   setRichText: (v: RichText | ((v: RichText) => RichText)) => void
   onPhotoPasted: (uri: string) => void
   onPressPublish: (richtext: RichText) => void
@@ -52,6 +53,7 @@ export const TextInput = React.forwardRef(function TextInputImpl(
   {
     richtext,
     placeholder,
+    webForceMinHeight,
     setRichText,
     onPhotoPasted,
     onPressPublish,
@@ -271,6 +273,13 @@ export const TextInput = React.forwardRef(function TextInputImpl(
     return style
   }, [t, fonts])
 
+  React.useLayoutEffect(() => {
+    let node = editor?.view.dom
+    if (node) {
+      node.style.minHeight = webForceMinHeight ? '140px' : ''
+    }
+  }, [editor, webForceMinHeight])
+
   return (
     <>
       <View style={styles.container}>
-- 
cgit 1.4.1

