You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
rename searchTerms to highlights, and support highlighting multiple search terms
This commit is contained in:
@@ -268,7 +268,7 @@ module.exports = React.createClass({
|
||||
{ avatar }
|
||||
{ sender }
|
||||
<div className="mx_EventTile_line">
|
||||
<EventTileType mxEvent={this.props.mxEvent} searchTerm={this.props.searchTerm} />
|
||||
<EventTileType mxEvent={this.props.mxEvent} highlights={this.props.highlights} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -47,6 +47,6 @@ module.exports = React.createClass({
|
||||
TileType = tileTypes[msgtype];
|
||||
}
|
||||
|
||||
return <TileType mxEvent={this.props.mxEvent} searchTerm={this.props.searchTerm} />;
|
||||
return <TileType mxEvent={this.props.mxEvent} highlights={this.props.highlights} />;
|
||||
},
|
||||
});
|
||||
|
||||
@@ -43,13 +43,13 @@ module.exports = React.createClass({
|
||||
shouldComponentUpdate: function(nextProps) {
|
||||
// exploit that events are immutable :)
|
||||
return (nextProps.mxEvent.getId() !== this.props.mxEvent.getId() ||
|
||||
nextProps.searchTerm !== this.props.searchTerm);
|
||||
nextProps.highlights !== this.props.highlights);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var mxEvent = this.props.mxEvent;
|
||||
var content = mxEvent.getContent();
|
||||
var body = HtmlUtils.bodyToHtml(content, this.props.searchTerm);
|
||||
var body = HtmlUtils.bodyToHtml(content, this.props.highlights);
|
||||
|
||||
switch (content.msgtype) {
|
||||
case "m.emote":
|
||||
|
||||
Reference in New Issue
Block a user