Skip to content

Commit 1233260

Browse files
committed
fix: styles for message input auto complete input
1 parent dabf914 commit 1233260

File tree

5 files changed

+22
-15
lines changed

5 files changed

+22
-15
lines changed

package/src/components/AutoCompleteInput/AutoCompleteInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ const AutoCompleteInputWithContext = (props: AutoCompleteInputPropsWithContext)
142142
{
143143
color: black,
144144
maxHeight: (textHeight || 17) * numberOfLines,
145+
paddingHorizontal: command ? 4 : 16,
145146
textAlign: I18nManager.isRTL ? 'right' : 'left',
146147
},
147148
inputBox,
@@ -205,8 +206,7 @@ const styles = StyleSheet.create({
205206
flex: 1,
206207
fontSize: 16,
207208
includeFontPadding: false, // for android vertical text centering
208-
padding: 0, // removal of default text input padding on android
209-
paddingTop: 0, // removal of iOS top padding for weird centering
209+
paddingVertical: 12,
210210
textAlignVertical: 'center', // for android vertical text centering
211211
},
212212
});

package/src/components/MessageInput/AttachmentUploadPreviewList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ export const AttachmentUploadPreviewList = (props: AttachmentUploadPreviewListPr
264264
const styles = StyleSheet.create({
265265
attachmentSeparator: {
266266
borderBottomWidth: 1,
267-
marginBottom: 10,
267+
marginVertical: 8,
268268
},
269-
filesFlatList: { marginBottom: 12, maxHeight: FILE_PREVIEW_HEIGHT * 2.5 + 16 },
270-
imagesFlatList: { paddingBottom: 12 },
269+
filesFlatList: { maxHeight: FILE_PREVIEW_HEIGHT * 2.5 + 16 },
270+
imagesFlatList: {},
271271
});
272272

273273
AttachmentUploadPreviewList.displayName =

package/src/components/MessageInput/MessageInput.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,14 @@ import { AutoCompleteInput } from '../AutoCompleteInput/AutoCompleteInput';
6363
import { CreatePoll } from '../Poll/CreatePollContent';
6464

6565
const styles = StyleSheet.create({
66+
attachmentPreviewListContainer: { paddingTop: 12 },
6667
attachmentSeparator: {
6768
borderBottomWidth: 1,
6869
marginBottom: 10,
6970
},
7071
autoCompleteInputContainer: {
7172
alignItems: 'center',
7273
flexDirection: 'row',
73-
paddingLeft: 16,
74-
paddingRight: 16,
7574
},
7675
composerContainer: {
7776
alignItems: 'center',
@@ -92,7 +91,7 @@ const styles = StyleSheet.create({
9291
optionsContainer: {
9392
flexDirection: 'row',
9493
},
95-
replyContainer: { paddingBottom: 12, paddingHorizontal: 8 },
94+
replyContainer: { paddingBottom: 0, paddingHorizontal: 8, paddingTop: 8 },
9695
sendButtonContainer: {},
9796
suggestionsListContainer: {
9897
position: 'absolute',
@@ -231,6 +230,7 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => {
231230
theme: {
232231
colors: { border, grey_whisper, white, white_smoke },
233232
messageInput: {
233+
attachmentPreviewListContainer,
234234
attachmentSelectionBar,
235235
autoCompleteInputContainer,
236236
composerContainer,
@@ -494,7 +494,6 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => {
494494
styles.inputBoxContainer,
495495
{
496496
borderColor: grey_whisper,
497-
paddingVertical: command ? 8 : 12,
498497
},
499498
inputBoxContainer,
500499
isFocused ? focusedInputBoxContainer : null,
@@ -505,7 +504,16 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => {
505504
<Reply />
506505
</View>
507506
)}
508-
<AttachmentUploadPreviewList />
507+
{attachments.length > 0 ? (
508+
<View
509+
style={[
510+
styles.attachmentPreviewListContainer,
511+
attachmentPreviewListContainer,
512+
]}
513+
>
514+
<AttachmentUploadPreviewList />
515+
</View>
516+
) : null}
509517
{command ? (
510518
<CommandInput disabled={!isOnline} />
511519
) : (

package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,6 @@ exports[`Thread should match thread snapshot 1`] = `
21352135
},
21362136
{
21372137
"borderColor": "#ECEBEB",
2138-
"paddingVertical": 12,
21392138
},
21402139
{},
21412140
null,
@@ -2148,8 +2147,6 @@ exports[`Thread should match thread snapshot 1`] = `
21482147
{
21492148
"alignItems": "center",
21502149
"flexDirection": "row",
2151-
"paddingLeft": 16,
2152-
"paddingRight": 16,
21532150
},
21542151
{},
21552152
]
@@ -2171,13 +2168,13 @@ exports[`Thread should match thread snapshot 1`] = `
21712168
"flex": 1,
21722169
"fontSize": 16,
21732170
"includeFontPadding": false,
2174-
"padding": 0,
2175-
"paddingTop": 0,
2171+
"paddingVertical": 12,
21762172
"textAlignVertical": "center",
21772173
},
21782174
{
21792175
"color": "#000000",
21802176
"maxHeight": 85,
2177+
"paddingHorizontal": 16,
21812178
"textAlign": "left",
21822179
},
21832180
{},

package/src/contexts/themeContext/utils/theme.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ export type Theme = {
267267
messageInput: {
268268
attachButton: ViewStyle;
269269
attachButtonContainer: ViewStyle;
270+
attachmentPreviewListContainer: ViewStyle;
270271
attachmentSelectionBar: ViewStyle;
271272
attachmentSeparator: ViewStyle;
272273
attachmentUnsupportedIndicator: {
@@ -1081,6 +1082,7 @@ export const defaultTheme: Theme = {
10811082
messageInput: {
10821083
attachButton: {},
10831084
attachButtonContainer: {},
1085+
attachmentPreviewListContainer: {},
10841086
attachmentSelectionBar: {},
10851087
attachmentSeparator: {},
10861088
attachmentUnsupportedIndicator: {

0 commit comments

Comments
 (0)