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

View file

@ -102,7 +102,7 @@ var SearchableEntityList = React.createClass({
getSearchResults: function(query, entities) { getSearchResults: function(query, entities) {
if (!query || query.length === 0) { if (!query || query.length === 0) {
return this.props.emptyQueryShowsAll ? entities : [ entities[0] ] return this.props.emptyQueryShowsAll ? entities : [];
} }
return entities.filter(function(e) { return entities.filter(function(e) {
return e.matches(query); return e.matches(query);
@ -135,20 +135,8 @@ var SearchableEntityList = React.createClass({
<form onSubmit={this.onQuerySubmit} autoComplete="off"> <form onSubmit={this.onQuerySubmit} autoComplete="off">
<input className="mx_SearchableEntityList_query" id="mx_SearchableEntityList_query" type="text" <input className="mx_SearchableEntityList_query" id="mx_SearchableEntityList_query" type="text"
onChange={this.onQueryChanged} value={this.state.query} onChange={this.onQueryChanged} value={this.state.query}
onFocus={ ()=>{ onFocus= {() => { this.setState({ focused: true }) }}
if (this._blurTimeout) { onBlur= {() => { this.setState({ focused: false }) }}
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
);
} }
placeholder={this.props.searchPlaceholderText} /> placeholder={this.props.searchPlaceholderText} />
</form> </form>
); );