about summary refs log tree commit diff
path: root/src/view/com/composer/text-input/TextInput.web.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-10-28 19:12:15 +0000
committerGitHub <noreply@github.com>2024-10-28 19:12:15 +0000
commitdcc5405e8a76037763950f2598721a30bb7934aa (patch)
tree0588f463a12ea9d33f67aa4ecbf290e5aa7a36fd /src/view/com/composer/text-input/TextInput.web.tsx
parent5bce043e1ebad182b06f63daab8b7e397771578e (diff)
downloadvoidsky-dcc5405e8a76037763950f2598721a30bb7934aa.tar.zst
Make composer min height conditional and align attachments (#5976)
* Make web composer min height condiitonal

* Fix alignment

* Fix alignment on mobile
Diffstat (limited to 'src/view/com/composer/text-input/TextInput.web.tsx')
-rw-r--r--src/view/com/composer/text-input/TextInput.web.tsx9
1 files changed, 9 insertions, 0 deletions
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}>