Temporary fix to longer text messages with window.width and also starting the scrollview transition

This commit is contained in:
talksik
2018-08-05 15:26:59 -07:00
parent a7b97e4aa1
commit 7554764860
+15 -11
View File
@@ -4,6 +4,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { import {
Dimensions, Dimensions,
ScrollView,
View, View,
Text, Text,
TextInput, TextInput,
@@ -154,9 +155,9 @@ export default class Chat extends Component<Props> {
</View> </View>
</View>) </View>)
: :
(<View style={styles.chatField}> (<ScrollView style={styles.chatField}>
{this.state.messagesDOM} {this.state.messagesDOM}
</View>) </ScrollView>)
} }
<View style={styles.inputMsgField}> <View style={styles.inputMsgField}>
@@ -202,8 +203,8 @@ const styles = {
}, },
msgCont: { msgCont: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignSelf: 'stretch',
margin: 2 padding: 5
}, },
userMsg: { userMsg: {
alignSelf: 'flex-end' alignSelf: 'flex-end'
@@ -222,19 +223,22 @@ const styles = {
margin: 5 margin: 5
}, },
msgTxtCont: { msgTxtCont: {
width: 0, maxWidth: windowWidth - 100,
flex: 1, padding: 10,
padding: 12, borderBottomRightRadius: 10,
borderBottomRightRadius: 15, borderBottomLeftRadius: 10,
borderBottomLeftRadius: 15 shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOpacity: 0.8,
shadowRadius: 2,
}, },
userMsgBox: { userMsgBox: {
backgroundColor: '#0e8f9e', backgroundColor: '#0e8f9e',
borderTopLeftRadius: 15 borderTopLeftRadius: 10
}, },
otherMsgBox: { otherMsgBox: {
backgroundColor: 'white', backgroundColor: 'white',
borderTopRightRadius: 15 borderTopRightRadius: 10
}, },
msgText: { msgText: {
fontFamily: Fonts.SunflowerLight, fontFamily: Fonts.SunflowerLight,