First draft, define message component as prop

This commit is contained in:
Tom Moor
2016-02-11 19:18:00 -08:00
parent a2d58e4b4e
commit a4f37e548a

View File

@@ -138,8 +138,14 @@ export default class Message extends React.Component {
} = this.props;
var flexStyle = {};
var rowView = Bubble;
if ( rowData.text.length > 40 ) {
flexStyle.flex = 1;
flexStyle.flex = 1;
}
if ( rowData.view ) {
rowView = rowData.view;
delete rowData.view;
}
return (
@@ -150,12 +156,9 @@ export default class Message extends React.Component {
}]}>
{position === 'left' ? this.renderImage(rowData, rowID, diffMessage, forceRenderImage, onImagePress) : null}
{position === 'right' ? this.renderErrorButton(rowData, rowID, onErrorButtonPress) : null}
<Bubble
position={rowData.position}
status={rowData.status}
text={rowData.text}
<rowView
{...rowData}
renderCustomText={this.props.renderCustomText}
styles={styles}
/>
{rowData.position === 'right' ? this.renderImage(rowData, rowID, diffMessage, forceRenderImage, onImagePress) : null}