Skip to content

Commit d81f894

Browse files
dbkrLuke Barnard
authored andcommitted
Add buttons to room sub list headers
Conflicts: src/components/structures/RoomSubList.js src/components/structures/RoomSubListHeader.js cherry-picking commit 095da68.
1 parent af305ea commit d81f894

4 files changed

Lines changed: 62 additions & 9 deletions

File tree

‎src/components/structures/RoomSubList.js‎

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
Copyright 2017 Vector Creations Ltd
23
Copyright 2015, 2016 OpenMarket Ltd
34
45
Licensed under the Apache License, Version 2.0 (the "License");
@@ -84,6 +85,7 @@ var RoomSubList = React.createClass({
8485
onShowMoreRooms: React.PropTypes.func,
8586
searchFilter: React.PropTypes.string,
8687
emptyContent: React.PropTypes.node, // content shown if the list is empty
88+
headerItems: React.PropTypes.node, // content shown in the sublist header
8789
},
8890

8991
getInitialState: function() {
@@ -553,7 +555,20 @@ var RoomSubList = React.createClass({
553555

554556
return connectDropTarget(
555557
<div>
556-
{ this._getHeaderJsx() }
558+
<RoomSubListHeader
559+
ref='header'
560+
label={ this.props.label }
561+
tagName={ this.props.tagName }
562+
roomCount={ roomCount }
563+
collapsed={ this.props.collapsed }
564+
hidden={ this.state.hidden }
565+
incomingCall={ this.props.incomingCall }
566+
isIncomingCallRoom={ isIncomingCallRoom }
567+
roomNotificationCount={ this.roomNotificationCount() }
568+
onClick={ this.onClick }
569+
onHeaderClick={ this.props.onHeaderClick }
570+
headerItems={this.props.headerItems}
571+
/>
557572
{ subList }
558573
</div>
559574
);
@@ -562,7 +577,21 @@ var RoomSubList = React.createClass({
562577
var Loader = sdk.getComponent("elements.Spinner");
563578
return (
564579
<div className="mx_RoomSubList">
565-
{ this.props.alwaysShowHeader ? this._getHeaderJsx() : undefined }
580+
{ this.props.alwaysShowHeader ?
581+
<RoomSubListHeader
582+
ref='header'
583+
label={ this.props.label }
584+
tagName={ this.props.tagName }
585+
roomCount={ roomCount }
586+
collapsed={ this.props.collapsed }
587+
hidden={ this.state.hidden }
588+
isIncomingCallRoom={ isIncomingCallRoom }
589+
roomNotificationCount={ this.roomNotificationCount() }
590+
onClick={ this.onClick }
591+
onHeaderClick={ this.props.onHeaderClick }
592+
headerItems={this.props.headerItems}
593+
/>
594+
: undefined }
566595
{ (this.props.showSpinner && !this.state.hidden) ? <Loader /> : undefined }
567596
</div>
568597
);

‎src/skins/vector/css/_components.scss‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
@import "./matrix-react-sdk/views/elements/_MemberEventListSummary.scss";
2828
@import "./matrix-react-sdk/views/elements/_ProgressBar.scss";
2929
@import "./matrix-react-sdk/views/elements/_RichText.scss";
30+
@import "./matrix-react-sdk/views/elements/_RoleButton.scss";
3031
@import "./matrix-react-sdk/views/login/_InteractiveAuthEntryComponents.scss";
3132
@import "./matrix-react-sdk/views/login/_ServerConfig.scss";
3233
@import "./matrix-react-sdk/views/messages/_MEmoteBody.scss";
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
Copyright 2107 Vector Creations Ltd
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_RoleButton {
18+
margin-left: 4px;
19+
margin-right: 4px;
20+
cursor: pointer;
21+
display: inline-block;
22+
}
23+
24+
.mx_RoleButton object {
25+
pointer-events: none;
26+
}

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,20 @@ limitations under the License.
3939
z-index: 6;
4040
}
4141

42-
.mx_RoomList_greyedSubListLabel {
43-
color: #a2a2a2;
44-
}
45-
4642
.mx_RoomList_emptySubListTip {
4743
font-size: 13px;
4844
margin-left: 18px;
4945
margin-right: 18px;
5046
margin-top: 8px;
5147
margin-bottom: 7px;
5248
padding: 5px;
53-
border: 1px solid $accent-color;
49+
border: 1px dashed $accent-color;
5450
color: $primary-fg-color;
5551
background-color: $droptarget-bg-color;
5652
border-radius: 4px;
5753
}
5854

59-
.mx_RoomList_butonPreview {
60-
float: right;
55+
.mx_RoomList_headerButtons {
56+
position: absolute;
57+
right: 60px;
6158
}

0 commit comments

Comments
 (0)