Skip to content

Commit af305ea

Browse files
dbkrLuke Barnard
authored andcommitted
Make left panel more friendly to new users
element-hq#3609
1 parent 36ec156 commit af305ea

2 files changed

Lines changed: 30 additions & 6 deletions

File tree

‎src/components/structures/RoomSubList.js‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ var RoomSubList = React.createClass({
8383
incomingCall: React.PropTypes.object,
8484
onShowMoreRooms: React.PropTypes.func,
8585
searchFilter: React.PropTypes.string,
86+
emptyContent: React.PropTypes.node, // content shown if the list is empty
8687
},
8788

8889
getInitialState: function() {
@@ -521,16 +522,18 @@ var RoomSubList = React.createClass({
521522

522523
render: function() {
523524
var connectDropTarget = this.props.connectDropTarget;
524-
var RoomDropTarget = sdk.getComponent('rooms.RoomDropTarget');
525525
var TruncatedList = sdk.getComponent('elements.TruncatedList');
526526

527527
var label = this.props.collapsed ? null : this.props.label;
528528

529529
//console.log("render: " + JSON.stringify(this.state.sortedList));
530530

531-
var target;
532-
if (this.state.sortedList.length == 0 && this.props.editable) {
533-
target = <RoomDropTarget label={ 'Drop here to ' + this.props.verb }/>;
531+
let content;
532+
if (this.state.sortedList.length == 0) {
533+
//content = <RoomDropTarget label={ 'Drop here to ' + this.props.verb }/>;
534+
content = this.props.emptyContent;
535+
} else {
536+
content = this.makeRoomTiles();
534537
}
535538

536539
if (this.state.sortedList.length > 0 || this.props.editable) {
@@ -540,8 +543,7 @@ var RoomSubList = React.createClass({
540543
if (!this.state.hidden) {
541544
subList = <TruncatedList className={ classes } truncateAt={this.state.truncateAt}
542545
createOverflowElement={this._createOverflowTile} >
543-
{ target }
544-
{ this.makeRoomTiles() }
546+
{ content }
545547
</TruncatedList>;
546548
}
547549
else {

‎src/skins/vector/css/matrix-react-sdk/views/rooms/_RoomList.scss‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
Copyright 2015, 2016 OpenMarket Ltd
3+
Copyright 2107 Vector Creations Ltd
34
45
Licensed under the Apache License, Version 2.0 (the "License");
56
you may not use this file except in compliance with the License.
@@ -37,3 +38,24 @@ limitations under the License.
3738
.mx_RoomList_scrollbar .gm-scrollbar.-vertical {
3839
z-index: 6;
3940
}
41+
42+
.mx_RoomList_greyedSubListLabel {
43+
color: #a2a2a2;
44+
}
45+
46+
.mx_RoomList_emptySubListTip {
47+
font-size: 13px;
48+
margin-left: 18px;
49+
margin-right: 18px;
50+
margin-top: 8px;
51+
margin-bottom: 7px;
52+
padding: 5px;
53+
border: 1px solid $accent-color;
54+
color: $primary-fg-color;
55+
background-color: $droptarget-bg-color;
56+
border-radius: 4px;
57+
}
58+
59+
.mx_RoomList_butonPreview {
60+
float: right;
61+
}

0 commit comments

Comments
 (0)