Make composer min height conditional and align attachments (#5976)

* Make web composer min height condiitonal

* Fix alignment

* Fix alignment on mobile
This commit is contained in:
dan
2024-10-28 19:12:15 +00:00
committed by GitHub
parent 5bce043e1e
commit dcc5405e8a
4 changed files with 18 additions and 7 deletions
@@ -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}>