From 1b8c5b50db450777fc57557fa2741d880807f0db Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 17 Oct 2017 18:02:35 +0100 Subject: [PATCH] Don't show room IDs when picking rooms --- src/components/views/dialogs/AddressPickerDialog.js | 8 +++++++- src/components/views/elements/AddressSelector.js | 10 +++++++++- src/components/views/elements/AddressTile.js | 5 ++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/components/views/dialogs/AddressPickerDialog.js b/src/components/views/dialogs/AddressPickerDialog.js index 2637f9d466..8c6f033bdc 100644 --- a/src/components/views/dialogs/AddressPickerDialog.js +++ b/src/components/views/dialogs/AddressPickerDialog.js @@ -489,7 +489,12 @@ module.exports = React.createClass({ const AddressTile = sdk.getComponent("elements.AddressTile"); for (let i = 0; i < this.state.userList.length; i++) { query.push( - , + , ); } } @@ -539,6 +544,7 @@ module.exports = React.createClass({ addressSelector = ( {this.addressSelector = ref;}} addressList={this.state.queryList} + showAddress={this.props.pickerType === 'user'} onSelected={this.onSelected} truncateAt={TRUNCATE_QUERY_LIST} /> diff --git a/src/components/views/elements/AddressSelector.js b/src/components/views/elements/AddressSelector.js index 9a8cd34867..9330206a39 100644 --- a/src/components/views/elements/AddressSelector.js +++ b/src/components/views/elements/AddressSelector.js @@ -30,6 +30,8 @@ export default React.createClass({ // List of the addresses to display addressList: React.PropTypes.arrayOf(UserAddressType).isRequired, + // Whether to show the address on the address tiles + showAddress: React.PropTypes.bool, truncateAt: React.PropTypes.number.isRequired, selected: React.PropTypes.number, @@ -142,7 +144,13 @@ export default React.createClass({ key={this.props.addressList[i].addressType + "/" + this.props.addressList[i].address} ref={(ref) => { this.addressListElement = ref; }} > - + , ); } diff --git a/src/components/views/elements/AddressTile.js b/src/components/views/elements/AddressTile.js index a61cbbc794..c8ea4062b1 100644 --- a/src/components/views/elements/AddressTile.js +++ b/src/components/views/elements/AddressTile.js @@ -87,7 +87,10 @@ export default React.createClass({ info = (
{ name }
-
{ address.address }
+ { this.props.showAddress ? +
{ address.address }
: +
+ }
); } else if (isMatrixAddress) {