Factor out common code between MemberTile and UserTile into EntityTile. Use EntityTile.
This commit is contained in:
parent
fd99b260f4
commit
71009d81b6
5 changed files with 149 additions and 157 deletions
|
@ -28,6 +28,7 @@ var SearchableEntityList = React.createClass({
|
|||
emptyQueryShowsAll: React.PropTypes.bool,
|
||||
onSubmit: React.PropTypes.func, // fn(inputText)
|
||||
entities: React.PropTypes.array,
|
||||
onEntityClick: React.PropTypes.func
|
||||
},
|
||||
|
||||
getDefaultProps: function() {
|
||||
|
@ -35,7 +36,8 @@ var SearchableEntityList = React.createClass({
|
|||
searchPlaceholderText: "Search",
|
||||
entities: [],
|
||||
emptyQueryShowsAll: false,
|
||||
onSubmit: function() {}
|
||||
onSubmit: function() {},
|
||||
onEntityClick: function() {}
|
||||
};
|
||||
},
|
||||
|
||||
|
@ -77,8 +79,8 @@ var SearchableEntityList = React.createClass({
|
|||
placeholder={this.props.searchPlaceholderText} />
|
||||
</form>
|
||||
<div className="mx_SearchableEntityList_list">
|
||||
{this.state.results.map(function(entity) {
|
||||
return entity.getJsx();
|
||||
{this.state.results.map((entity) => {
|
||||
return entity.getJsx(this.props.onEntityClick);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue