From f562158e837a2157fff231febf2b312137af9a7a Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 7 Mar 2025 10:25:44 -0600 Subject: [PATCH] Revert "#6861: Use available space to make focus on Composer TextInput easier (copy) (#7836)" This reverts commit e40656128d2fad41762ec1e7f022bc10fcdd25fc. --- src/view/com/composer/Composer.tsx | 36 +++++++++++-------- .../com/composer/text-input/TextInput.tsx | 6 ++-- src/view/com/util/UserAvatar.tsx | 25 ++----------- 3 files changed, 27 insertions(+), 40 deletions(-) diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index e80b804493..e8fe1a7ce7 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -657,7 +657,6 @@ export const ComposePost = ({ ref={scrollViewRef} layout={native(LinearTransition)} onScroll={scrollHandler} - contentContainerStyle={a.flex_grow} style={a.flex_1} keyboardShouldPersistTaps="always" onContentSizeChange={onScrollViewContentSizeChange} @@ -796,22 +795,19 @@ let ComposerPost = React.memo(function ComposerPost({ ) return ( - - + + )} - {embed.quote?.uri ? ( - + + + {embed.quote?.uri ? ( @@ -1091,8 +1088,8 @@ function ComposerEmbeds({ dispatch({type: 'embed_remove_quote'})} /> )} - - ) : null} + ) : null} + ) } @@ -1472,6 +1469,7 @@ const styles = StyleSheet.create({ marginLeft: 12, }, stickyFooterWeb: { + // @ts-ignore web-only position: 'sticky', bottom: 0, }, @@ -1505,9 +1503,19 @@ const styles = StyleSheet.create({ justifyContent: 'center', marginRight: 5, }, + post: { + marginHorizontal: 16, + }, inactivePost: { opacity: 0.5, }, + textInputLayout: { + flexDirection: 'row', + paddingTop: 4, + }, + textInputLayoutMobile: { + flex: 1, + }, addExtLinkBtn: { borderWidth: 1, borderRadius: 24, diff --git a/src/view/com/composer/text-input/TextInput.tsx b/src/view/com/composer/text-input/TextInput.tsx index 22d1f1d083..55fd3650fe 100644 --- a/src/view/com/composer/text-input/TextInput.tsx +++ b/src/view/com/composer/text-input/TextInput.tsx @@ -249,11 +249,9 @@ export const TextInput = forwardRef(function TextInputImpl( multiline scrollEnabled={false} numberOfLines={2} - {...props} style={[ inputTextStyle, a.w_full, - a.h_full, { textAlignVertical: 'top', minHeight: 60, @@ -263,8 +261,8 @@ export const TextInput = forwardRef(function TextInputImpl( borderWidth: 1, borderColor: 'transparent', }, - props.style, - ]}> + ]} + {...props}> {textDecorated} void - style?: StyleProp } interface EditableUserAvatarProps extends BaseUserAvatarProps { @@ -189,7 +181,6 @@ let UserAvatar = ({ moderation, usePlainRNImage = false, onLoad, - style, }: UserAvatarProps): React.ReactNode => { const pal = usePalette('default') const backgroundColor = pal.colors.backgroundLight @@ -227,19 +218,9 @@ let UserAvatar = ({ ) }, [moderation?.alert, size, pal]) - const containerStyle = useMemo(() => { - return [ - { - width: size, - height: size, - }, - style, - ] - }, [size, style]) - return avatar && !((moderation?.blur && isAndroid) /* android crashes with blur */) ? ( - + {usePlainRNImage ? ( ) : ( - + {alert}