2015-07-12 20:51:24 -04:00
|
|
|
/*
|
|
|
|
Copyright 2015 OpenMarket Ltd
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var React = require('react');
|
2015-09-22 13:49:04 -04:00
|
|
|
var sdk = require('matrix-react-sdk')
|
2015-10-11 08:54:38 -04:00
|
|
|
var dis = require('matrix-react-sdk/lib/dispatcher');
|
2015-07-12 20:51:24 -04:00
|
|
|
|
|
|
|
module.exports = React.createClass({
|
|
|
|
displayName: 'LeftPanel',
|
|
|
|
|
2015-10-10 21:09:14 -04:00
|
|
|
onHideClick: function() {
|
2015-10-11 08:54:38 -04:00
|
|
|
dis.dispatch({
|
|
|
|
action: 'hide_left_panel',
|
|
|
|
});
|
2015-10-10 21:09:14 -04:00
|
|
|
},
|
|
|
|
|
2015-07-12 20:51:24 -04:00
|
|
|
render: function() {
|
2015-09-22 13:49:04 -04:00
|
|
|
var RoomList = sdk.getComponent('organisms.RoomList');
|
|
|
|
var BottomLeftMenu = sdk.getComponent('molecules.BottomLeftMenu');
|
|
|
|
var IncomingCallBox = sdk.getComponent('molecules.voip.IncomingCallBox');
|
|
|
|
|
2015-10-10 21:09:14 -04:00
|
|
|
var collapseButton;
|
|
|
|
var classes = "mx_LeftPanel";
|
2015-10-11 08:54:38 -04:00
|
|
|
if (this.props.collapsed) {
|
2015-10-10 21:09:14 -04:00
|
|
|
classes += " collapsed";
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
collapseButton = <img className="mx_LeftPanel_hideButton" onClick={ this.onHideClick } src="img/hide.png" width="12" height="20" alt="<"/>
|
|
|
|
}
|
|
|
|
|
2015-07-12 20:51:24 -04:00
|
|
|
return (
|
2015-10-10 21:09:14 -04:00
|
|
|
<aside className={classes}>
|
|
|
|
{ collapseButton }
|
2015-07-16 11:32:11 -04:00
|
|
|
<IncomingCallBox />
|
2015-10-11 08:54:38 -04:00
|
|
|
<RoomList selectedRoom={this.props.selectedRoom} collapsed={this.props.collapsed}/>
|
2015-07-20 23:11:24 -04:00
|
|
|
<BottomLeftMenu />
|
2015-08-10 10:17:15 -04:00
|
|
|
</aside>
|
2015-07-12 20:51:24 -04:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|