1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-13 23:41:50 +03:00

Improve reply rendering

Signed-off-by: Tulir Asokan <tulir@maunium.net>
This commit is contained in:
Tulir Asokan
2019-10-13 15:08:50 +03:00
parent 385e83fdbc
commit d282675bc6
9 changed files with 388 additions and 30 deletions

View File

@ -43,6 +43,9 @@ module.exports = createReactClass({
/* the maximum image height to use, if the event is an image */
maxImageHeight: PropTypes.number,
overrideBodyTypes: PropTypes.object,
overrideEventTypes: PropTypes.object,
},
getEventTileOps: function() {
@ -60,9 +63,11 @@ module.exports = createReactClass({
'm.file': sdk.getComponent('messages.MFileBody'),
'm.audio': sdk.getComponent('messages.MAudioBody'),
'm.video': sdk.getComponent('messages.MVideoBody'),
...(this.props.overrideBodyTypes || {}),
};
const evTypes = {
'm.sticker': sdk.getComponent('messages.MStickerBody'),
...(this.props.overrideEventTypes || {}),
};
const content = this.props.mxEvent.getContent();
@ -81,7 +86,7 @@ module.exports = createReactClass({
}
}
return <BodyType
return BodyType ? <BodyType
ref="body" mxEvent={this.props.mxEvent}
highlights={this.props.highlights}
highlightLink={this.props.highlightLink}
@ -90,6 +95,6 @@ module.exports = createReactClass({
maxImageHeight={this.props.maxImageHeight}
replacingEventId={this.props.replacingEventId}
editState={this.props.editState}
onHeightChanged={this.props.onHeightChanged} />;
onHeightChanged={this.props.onHeightChanged} /> : null;
},
});