Skip to content

Commit c17574c

Browse files
authored
fix: composer styling - [CU-869bfu16g] (#223)
1 parent 7693061 commit c17574c

6 files changed

Lines changed: 146 additions & 193 deletions

File tree

src/components/ui/Avatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const Avatar = ({
120120
const styles = StyleSheet.create({
121121
container: {
122122
flexDirection: 'row',
123-
alignItems: 'center',
123+
alignItems: 'flex-start',
124124
gap: 8,
125125
justifyContent: 'space-between',
126126
},

src/components/ui/HighlightableTextInput.tsx

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useRef } from 'react';
1+
import React, { useMemo, useRef } from 'react';
22

33
import { TextInput as RNTextInput, StyleProp, TextInputProps, TextStyle, View } from 'react-native';
44

@@ -36,25 +36,34 @@ const HighlightableTextInput: React.FC<HighlightableTextInputProps> = ({
3636
const highlightColor = currentColors.primary;
3737
const textInputRef = useRef<RNTextInput>(null);
3838

39-
const highlightStyle = { fontWeight: 'bold' as const, color: highlightColor };
39+
const highlightStyle = useMemo(
40+
() => ({ fontWeight: 'bold' as const, color: highlightColor }),
41+
[highlightColor]
42+
);
4043

41-
const triggersConfig = {
42-
mention: {
43-
trigger: '@',
44-
textStyle: highlightStyle,
45-
},
46-
};
44+
const triggersConfig = useMemo(
45+
() => ({
46+
mention: {
47+
trigger: '@',
48+
textStyle: highlightStyle,
49+
},
50+
}),
51+
[highlightStyle]
52+
);
4753

48-
const patternsConfig = {
49-
mention: {
50-
pattern: /(@\w+)/,
51-
textStyle: highlightStyle,
52-
},
53-
hashtag: {
54-
pattern: /(#\w+)/,
55-
textStyle: highlightStyle,
56-
},
57-
};
54+
const patternsConfig = useMemo(
55+
() => ({
56+
mention: {
57+
pattern: /(@\w+)/,
58+
textStyle: highlightStyle,
59+
},
60+
hashtag: {
61+
pattern: /(#\w+)/,
62+
textStyle: highlightStyle,
63+
},
64+
}),
65+
[highlightStyle]
66+
);
5867

5968
const { textInputProps, triggers } = useMentions({
6069
value,
@@ -72,6 +81,7 @@ const HighlightableTextInput: React.FC<HighlightableTextInputProps> = ({
7281
placeholderTextColor={placeholderTextColor}
7382
style={style}
7483
multiline={multiline}
84+
scrollEnabled={false}
7585
textAlignVertical={textAlignVertical}
7686
testID={testID}
7787
autoCorrect={false}

src/components/ui/ReplyInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function getStyles(theme: 'dark' | 'light', isFocused: boolean) {
155155
backgroundColor: colors[theme].background,
156156
paddingHorizontal: 0,
157157
paddingTop: 8,
158-
paddingBottom: Platform.OS === 'ios' ? (isFocused ? 12 : 0) : 0,
158+
paddingBottom: Platform.OS === 'ios' ? 0 : 16,
159159
},
160160
replyingToContainer: {
161161
paddingHorizontal: 16,

0 commit comments

Comments
 (0)