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:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user