Add 'searching known users' to the user picker

So it's more obvious it's only finding people you've already seen

Fixes https://github.com/vector-im/riot-web/issues/2931
pull/21833/head
David Baker 2017-01-17 14:48:50 +00:00
parent fcb1d7a664
commit 0b67fd5b4e
2 changed files with 10 additions and 1 deletions

View File

@ -396,11 +396,16 @@ module.exports = React.createClass({
if (this.state.error) { if (this.state.error) {
error = <div className="mx_ChatInviteDialog_error">You have entered an invalid contact. Try using their Matrix ID or email address.</div> error = <div className="mx_ChatInviteDialog_error">You have entered an invalid contact. Try using their Matrix ID or email address.</div>
} else { } else {
const addressSelectorHeader = <div className="mx_ChatInviteDialog_addressSelectHeader">
Searching known users
</div>;
addressSelector = ( addressSelector = (
<AddressSelector ref={(ref) => {this.addressSelector = ref}} <AddressSelector ref={(ref) => {this.addressSelector = ref}}
addressList={ this.state.queryList } addressList={ this.state.queryList }
onSelected={ this.onSelected } onSelected={ this.onSelected }
truncateAt={ TRUNCATE_QUERY_LIST } /> truncateAt={ TRUNCATE_QUERY_LIST }
header={ addressSelectorHeader }
/>
); );
} }

View File

@ -28,6 +28,9 @@ module.exports = React.createClass({
addressList: React.PropTypes.array.isRequired, addressList: React.PropTypes.array.isRequired,
truncateAt: React.PropTypes.number.isRequired, truncateAt: React.PropTypes.number.isRequired,
selected: React.PropTypes.number, selected: React.PropTypes.number,
// Element to put as a header on top of the list
header: React.PropTypes.node,
}, },
getInitialState: function() { getInitialState: function() {
@ -147,6 +150,7 @@ module.exports = React.createClass({
return ( return (
<div className={classes} ref={(ref) => {this.scrollElement = ref}}> <div className={classes} ref={(ref) => {this.scrollElement = ref}}>
{ this.props.header }
{ this.createAddressListTiles() } { this.createAddressListTiles() }
</div> </div>
); );