Skip to content

Commit 8e0be29

Browse files
authored
Merge pull request element-hq#2380 from vector-im/dbkr/roomdir_no_results
Room directory: indicate when there are no results
2 parents 5b3524f + 2a37a0c commit 8e0be29

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

‎src/components/structures/RoomDirectory.js‎

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -414,20 +414,25 @@ module.exports = React.createClass({
414414
<Loader />
415415
</div>;
416416
} else {
417-
const ScrollPanel = sdk.getComponent("structures.ScrollPanel");
418-
content = <ScrollPanel ref={this.collectScrollPanel}
419-
className="mx_RoomDirectory_tableWrapper"
420-
onFillRequest={ this.onFillRequest }
421-
stickyBottom={false}
422-
startAtBottom={false}
423-
onResize={function(){}}
424-
>
425-
<table ref="directory_table" className="mx_RoomDirectory_table">
426-
<tbody>
427-
{ this.getRows() }
428-
</tbody>
429-
</table>
430-
</ScrollPanel>;
417+
const rows = this.getRows();
418+
if (rows.length == 0) {
419+
content = <i>No rooms to show</i>;
420+
} else {
421+
const ScrollPanel = sdk.getComponent("structures.ScrollPanel");
422+
content = <ScrollPanel ref={this.collectScrollPanel}
423+
className="mx_RoomDirectory_tableWrapper"
424+
onFillRequest={ this.onFillRequest }
425+
stickyBottom={false}
426+
startAtBottom={false}
427+
onResize={function(){}}
428+
>
429+
<table ref="directory_table" className="mx_RoomDirectory_table">
430+
<tbody>
431+
{ this.getRows() }
432+
</tbody>
433+
</table>
434+
</ScrollPanel>;
435+
}
431436
}
432437

433438
const SimpleRoomHeader = sdk.getComponent('rooms.SimpleRoomHeader');

0 commit comments

Comments
 (0)