mirror of
https://github.com/zhigang1992/react-native-gifted-chat.git
synced 2026-04-28 20:25:43 +08:00
First draft, define message component as prop
This commit is contained in:
15
Message.js
15
Message.js
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user