Skip to content

Commit 12c8243

Browse files
committed
rename DirectoryMenu as BottomLeftMenu and implement a really really really basic RoomDirectory
1 parent fe71f69 commit 12c8243

12 files changed

Lines changed: 279 additions & 38 deletions

File tree

‎examples/trivial/fonts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../skins/base/fonts/

‎skins/base/css/molecules/RoomHeader.css‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ limitations under the License.
8686
vertical-align: middle;
8787
}
8888

89+
.mx_RoomHeader_simpleHeader {
90+
line-height: 88px;
91+
color: #80cef4;
92+
font-weight: 400;
93+
font-size: 20px;
94+
overflow: scroll;
95+
text-overflow: ellipsis;
96+
}
97+
8998
.mx_RoomHeader_name {
9099
vertical-align: middle;
91100
height: 28px;

‎skins/base/css/organisms/LeftPanel.css‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ limitations under the License.
4343
overflow-y: scroll;
4444
}
4545

46-
.mx_LeftPanel .mx_DirectoryMenu {
46+
.mx_LeftPanel .mx_BottomLeftMenu {
4747
-webkit-box-ordinal-group: 3;
4848
-moz-box-ordinal-group: 3;
4949
-ms-flex-order: 3;
@@ -56,15 +56,15 @@ limitations under the License.
5656
border-top: 1px solid #f3f8fa;
5757
}
5858

59-
.mx_LeftPanel .mx_DirectoryMenu .mx_RoomTile {
59+
.mx_LeftPanel .mx_BottomLeftMenu .mx_RoomTile {
6060
color: #378bb4;
6161
}
6262

63-
.mx_LeftPanel .mx_DirectoryMenu .mx_RoomTile_avatar {
63+
.mx_LeftPanel .mx_BottomLeftMenu .mx_RoomTile_avatar {
6464
padding-left: 14px;
6565
}
6666

67-
.mx_LeftPanel .mx_DirectoryMenu .mx_DirectoryMenu_options {
67+
.mx_LeftPanel .mx_BottomLeftMenu .mx_BottomLeftMenu_options {
6868
margin-top: 12px;
6969
width: 100%;
7070
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
Copyright 2015 OpenMarket 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_RoomDirectory {
18+
max-width: 720px;
19+
margin: auto;
20+
}
21+
22+
.mx_RoomDirectory_input {
23+
margin: auto;
24+
border-radius: 3px;
25+
border: 1px solid #c7c7c7;
26+
font-weight: 300;
27+
font-size: 14px;
28+
padding: 9px;
29+
margin-top: 12px;
30+
margin-bottom: 12px;
31+
}
32+
33+
.mx_RoomDirectory_table {
34+
width: 100%;
35+
}
36+
37+
.mx_RoomDirectory_table td,
38+
.mx_RoomDirectory_table th, {
39+
padding: 6px;
40+
}

skins/base/views/molecules/DirectoryMenu.js renamed to skins/base/views/molecules/BottomLeftMenu.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,34 @@ var classNames = require('classnames');
2121

2222
var dis = require("../../../../src/dispatcher");
2323

24-
//var DirectoryMenuController = require("../../../../src/controllers/molecules/DirectoryMenuController");
25-
2624
var MatrixClientPeg = require("../../../../src/MatrixClientPeg");
2725

2826
module.exports = React.createClass({
29-
displayName: 'DirectoryMenu',
30-
// mixins: [DirectoryMenuController],
27+
displayName: 'BottomLeftMenu',
3128

32-
// FIXME: should these onClicks be in the controller instead?
3329
onSettingsClick: function() {
3430
dis.dispatch({action: 'view_user_settings'});
3531
},
3632

33+
onRoomDirectoryClick: function() {
34+
dis.dispatch({action: 'view_room_directory'});
35+
},
36+
3737
onCreateRoomClick: function() {
3838
dis.dispatch({action: 'view_create_room'});
3939
},
4040

4141
render: function() {
4242
return (
43-
<div className="mx_DirectoryMenu">
44-
<div className="mx_DirectoryMenu_options">
43+
<div className="mx_BottomLeftMenu">
44+
<div className="mx_BottomLeftMenu_options">
4545
<div className="mx_RoomTile" onClick={this.onCreateRoomClick}>
4646
<div className="mx_RoomTile_avatar">
4747
<img src="img/create-big.png" width="42" height="42"/>
4848
</div>
4949
<div className="mx_RoomTile_name">Create new room</div>
5050
</div>
51-
<div className="mx_RoomTile">
51+
<div className="mx_RoomTile" onClick={this.onRoomDirectoryClick}>
5252
<div className="mx_RoomTile_avatar">
5353
<img src="img/directory-big.png" width="42" height="42"/>
5454
</div>

‎skins/base/views/molecules/RoomHeader.js‎

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,34 @@ module.exports = React.createClass({
3535

3636
render: function() {
3737

38-
var topic = this.props.room.currentState.getStateEvents('m.room.topic', '');
39-
topic = topic ? <div className="mx_RoomHeader_topic">{ topic.getContent().topic }</div> : null;
38+
var header;
39+
if (this.props.simpleHeader) {
40+
header =
41+
<div className="mx_RoomHeader_wrapper">
42+
<div className="mx_RoomHeader_simpleHeader">
43+
{ this.props.simpleHeader }
44+
</div>
45+
</div>
46+
}
47+
else {
48+
var topic = this.props.room.currentState.getStateEvents('m.room.topic', '');
49+
topic = topic ? <div className="mx_RoomHeader_topic">{ topic.getContent().topic }</div> : null;
4050

41-
var callButtons;
42-
if (this.state) {
43-
switch (this.state.call_state) {
44-
case "ringback":
45-
case "connected":
46-
callButtons = (
47-
<div className="mx_RoomHeader_hangupButton" onClick={this.onHangupClick}>
48-
End call
49-
</div>
50-
);
51-
break;
51+
var callButtons;
52+
if (this.state) {
53+
switch (this.state.call_state) {
54+
case "ringback":
55+
case "connected":
56+
callButtons = (
57+
<div className="mx_RoomHeader_hangupButton" onClick={this.onHangupClick}>
58+
End call
59+
</div>
60+
);
61+
break;
62+
}
5263
}
53-
}
5464

55-
return (
56-
<div className="mx_RoomHeader">
65+
header =
5766
<div className="mx_RoomHeader_wrapper">
5867
<div className="mx_RoomHeader_leftRow">
5968
<div className="mx_RoomHeader_avatar">
@@ -82,6 +91,11 @@ module.exports = React.createClass({
8291
</div>
8392
</div>
8493
</div>
94+
}
95+
96+
return (
97+
<div className="mx_RoomHeader">
98+
{ header }
8599
</div>
86100
);
87101
},

‎skins/base/views/organisms/LeftPanel.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var React = require('react');
2020
var ComponentBroker = require('../../../../src/ComponentBroker');
2121

2222
var RoomList = ComponentBroker.get('organisms/RoomList');
23-
var DirectoryMenu = ComponentBroker.get('molecules/DirectoryMenu');
23+
var BottomLeftMenu = ComponentBroker.get('molecules/BottomLeftMenu');
2424
var IncomingCallBox = ComponentBroker.get('molecules/voip/IncomingCallBox');
2525
var RoomCreate = ComponentBroker.get('molecules/RoomCreate');
2626

@@ -33,7 +33,7 @@ module.exports = React.createClass({
3333
<img className="mx_LeftPanel_hideButton" src="img/hide.png" width="32" height="32" alt="<"/>
3434
<IncomingCallBox />
3535
<RoomList selectedRoom={this.props.selectedRoom} />
36-
<DirectoryMenu />
36+
<BottomLeftMenu />
3737
</div>
3838
);
3939
}

‎skins/base/views/organisms/RightPanel.js‎

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,53 @@ var MemberList = ComponentBroker.get('organisms/MemberList');
2424
module.exports = React.createClass({
2525
displayName: 'RightPanel',
2626

27+
Phase : {
28+
Blank: 'Blank',
29+
None: 'None',
30+
MemberList: 'MemberList',
31+
FileList: 'FileList',
32+
},
33+
34+
getInitialState: function() {
35+
return {
36+
phase : this.Phase.None
37+
}
38+
},
39+
40+
onMemberListButtonClick: function() {
41+
if (this.state.phase == this.Phase.None) {
42+
this.setState({ phase: this.Phase.MemberList });
43+
}
44+
else {
45+
this.setState({ phase: this.Phase.None });
46+
}
47+
},
48+
2749
render: function() {
28-
return (
29-
<div className="mx_RightPanel">
30-
<div className="mx_RightPanel_header">
50+
var buttonGroup;
51+
var panel;
52+
if (this.props.roomId) {
53+
buttonGroup =
3154
<div className="mx_RightPanel_headerButtonGroup">
3255
<div className="mx_RightPanel_headerButton">
3356
<img src="img/file.png" width="32" height="32" alt="Files"/>
3457
</div>
35-
<div className="mx_RightPanel_headerButton">
58+
<div className="mx_RightPanel_headerButton" onClick={ this.onMemberListButtonClick }>
3659
<img src="img/members.png" width="32" height="32" alt="Members"/>
3760
</div>
38-
</div>
61+
</div>;
62+
63+
if (this.state.phase == this.Phase.MemberList) {
64+
panel = <MemberList roomId={this.props.roomId} key={this.props.roomId} />
65+
}
66+
}
67+
68+
return (
69+
<div className="mx_RightPanel">
70+
<div className="mx_RightPanel_header">
71+
{ buttonGroup }
3972
</div>
40-
<MemberList roomId={this.props.roomId} key={this.props.roomId} />
73+
{ panel }
4174
</div>
4275
);
4376
}

0 commit comments

Comments
 (0)