Removed the Email (Invite by email) section

This commit is contained in:
wmwragg 2016-09-14 18:01:07 +01:00
parent a06896f96c
commit 6a91948469
2 changed files with 17 additions and 29 deletions

View file

@ -90,7 +90,7 @@ module.exports = React.createClass({
var EntityTile = sdk.getComponent("rooms.EntityTile");
var BaseAvatar = sdk.getComponent("avatars.BaseAvatar");
var label = input;
// var label = input;
// if (input[0] === "@") {
// label = input;
// }
@ -98,16 +98,16 @@ module.exports = React.createClass({
// label = "Email: " + input;
// }
this._emailEntity = new Entities.newEntity(
<EntityTile key="dynamic_invite_tile" suppressOnHover={true} showInviteButton={true}
avatarJsx={ <BaseAvatar name="@" width={36} height={36} /> }
className="mx_EntityTile_invitePlaceholder"
presenceState="online" onClick={this.onThirdPartyInvite} name={"Invite by email"}
/>,
function(query) {
return true; // always show this
}
);
// this._emailEntity = new Entities.newEntity(
// <EntityTile key="dynamic_invite_tile" suppressOnHover={true} showInviteButton={true}
// avatarJsx={ <BaseAvatar name="@" width={36} height={36} /> }
// className="mx_EntityTile_invitePlaceholder"
// presenceState="online" onClick={this.onThirdPartyInvite} name={"Invite by email"}
// />,
// function(query) {
// return true; // always show this
// }
// );
this.props.onSearchQueryChanged(input);
},
@ -117,9 +117,9 @@ module.exports = React.createClass({
var entities = Entities.fromUsers(this._userList || [], true, this.props.onInvite);
// Add an "Email: foo@bar.com" tile as the first tile
if (this._emailEntity) {
entities.unshift(this._emailEntity);
}
// if (this._emailEntity) {
// entities.unshift(this._emailEntity);
// }
return (
<SearchableEntityList searchPlaceholderText={"Search/invite by name, email, id"}

View file

@ -102,7 +102,7 @@ var SearchableEntityList = React.createClass({
getSearchResults: function(query, entities) {
if (!query || query.length === 0) {
return this.props.emptyQueryShowsAll ? entities : [ entities[0] ]
return this.props.emptyQueryShowsAll ? entities : [];
}
return entities.filter(function(e) {
return e.matches(query);
@ -135,20 +135,8 @@ var SearchableEntityList = React.createClass({
<form onSubmit={this.onQuerySubmit} autoComplete="off">
<input className="mx_SearchableEntityList_query" id="mx_SearchableEntityList_query" type="text"
onChange={this.onQueryChanged} value={this.state.query}
onFocus={ ()=>{
if (this._blurTimeout) {
clearTimeout(this.blurTimeout);
}
this.setState({ focused: true });
} }
onBlur={ ()=>{
// nasty setTimeout heuristic to avoid the 'invite by email' prompt disappearing
// due to the onBlur before we can click on it
this._blurTimeout = setTimeout(
()=>{ this.setState({ focused: false }) },
300
);
} }
onFocus= {() => { this.setState({ focused: true }) }}
onBlur= {() => { this.setState({ focused: false }) }}
placeholder={this.props.searchPlaceholderText} />
</form>
);