|
1 | 1 | /* @flow strict-local */
|
2 | 2 | import React, { PureComponent } from 'react';
|
3 |
| -import { View, TextInput, findNodeHandle } from 'react-native'; |
| 3 | +import { Platform, View, TextInput, findNodeHandle } from 'react-native'; |
4 | 4 | import { connect } from 'react-redux';
|
5 | 5 | import TextInputReset from 'react-native-text-input-reset';
|
6 | 6 |
|
@@ -251,10 +251,43 @@ class ComposeBox extends PureComponent<Props, State> {
|
251 | 251 | }
|
252 | 252 | }
|
253 | 253 |
|
| 254 | + inputMarginPadding = { |
| 255 | + paddingHorizontal: 8, |
| 256 | + paddingVertical: Platform.select({ |
| 257 | + ios: 8, |
| 258 | + android: 2, |
| 259 | + }), |
| 260 | + }; |
| 261 | + |
254 | 262 | styles = {
|
255 |
| - topicInput: [styles.topicInput, this.context.styles.backgroundColor], |
| 263 | + composeBox: { |
| 264 | + flexDirection: 'row', |
| 265 | + backgroundColor: 'rgba(127, 127, 127, 0.1)', |
| 266 | + }, |
| 267 | + composeText: { |
| 268 | + flex: 1, |
| 269 | + paddingVertical: 8, |
| 270 | + justifyContent: 'center', |
| 271 | + }, |
| 272 | + composeSendButton: { |
| 273 | + padding: 8, |
| 274 | + }, |
| 275 | + topicInput: [ |
| 276 | + { |
| 277 | + borderWidth: 0, |
| 278 | + borderRadius: 5, |
| 279 | + marginBottom: 8, |
| 280 | + ...this.inputMarginPadding, |
| 281 | + }, |
| 282 | + this.context.styles.backgroundColor, |
| 283 | + ], |
256 | 284 | composeTextInput: [
|
257 |
| - styles.composeTextInput, |
| 285 | + { |
| 286 | + borderWidth: 0, |
| 287 | + borderRadius: 5, |
| 288 | + fontSize: 15, |
| 289 | + ...this.inputMarginPadding, |
| 290 | + }, |
258 | 291 | this.context.styles.backgroundColor,
|
259 | 292 | this.context.styles.color,
|
260 | 293 | ],
|
@@ -298,15 +331,15 @@ class ComposeBox extends PureComponent<Props, State> {
|
298 | 331 | onMessageAutocomplete={this.handleMessageAutocomplete}
|
299 | 332 | onTopicAutocomplete={this.handleTopicAutocomplete}
|
300 | 333 | />
|
301 |
| - <View style={styles.composeBox} onLayout={this.handleLayoutChange}> |
| 334 | + <View style={this.styles.composeBox} onLayout={this.handleLayoutChange}> |
302 | 335 | <View style={styles.alignBottom}>
|
303 | 336 | <ComposeMenu
|
304 | 337 | destinationNarrow={this.getDestinationNarrow()}
|
305 | 338 | expanded={isMenuExpanded}
|
306 | 339 | onExpandContract={this.handleComposeMenuToggle}
|
307 | 340 | />
|
308 | 341 | </View>
|
309 |
| - <View style={styles.composeText}> |
| 342 | + <View style={this.styles.composeText}> |
310 | 343 | {this.getCanSelectTopic() && (
|
311 | 344 | <Input
|
312 | 345 | style={this.styles.topicInput}
|
@@ -341,7 +374,7 @@ class ComposeBox extends PureComponent<Props, State> {
|
341 | 374 | </View>
|
342 | 375 | <View style={styles.alignBottom}>
|
343 | 376 | <FloatingActionButton
|
344 |
| - style={styles.composeSendButton} |
| 377 | + style={this.styles.composeSendButton} |
345 | 378 | Icon={editMessage === null ? IconSend : IconDone}
|
346 | 379 | size={32}
|
347 | 380 | disabled={message.trim().length === 0}
|
|
0 commit comments