2015-07-13 03:51:24 +03: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 20:49:04 +03:00
|
|
|
var sdk = require('matrix-react-sdk')
|
2015-07-13 03:51:24 +03:00
|
|
|
|
|
|
|
module.exports = React.createClass({
|
|
|
|
displayName: 'LeftPanel',
|
|
|
|
|
2015-10-11 04:09:14 +03:00
|
|
|
getInitialState: function() {
|
|
|
|
return {
|
|
|
|
collapsed: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
onShowClick: function() {
|
|
|
|
this.setState({ collapsed : false });
|
|
|
|
},
|
|
|
|
|
|
|
|
onHideClick: function() {
|
|
|
|
this.setState({ collapsed : true });
|
|
|
|
},
|
|
|
|
|
2015-07-13 03:51:24 +03:00
|
|
|
render: function() {
|
2015-09-22 20:49:04 +03:00
|
|
|
var RoomList = sdk.getComponent('organisms.RoomList');
|
|
|
|
var BottomLeftMenu = sdk.getComponent('molecules.BottomLeftMenu');
|
|
|
|
var IncomingCallBox = sdk.getComponent('molecules.voip.IncomingCallBox');
|
|
|
|
|
2015-10-11 04:09:14 +03:00
|
|
|
var collapseButton;
|
|
|
|
var classes = "mx_LeftPanel";
|
|
|
|
if (this.state.collapsed) {
|
|
|
|
classes += " collapsed";
|
|
|
|
collapseButton = <img className="mx_LeftPanel_showButton" onClick={ this.onShowClick } src="img/menu.png" width="27" height="20" alt=">"/>
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
collapseButton = <img className="mx_LeftPanel_hideButton" onClick={ this.onHideClick } src="img/hide.png" width="12" height="20" alt="<"/>
|
|
|
|
}
|
|
|
|
|
2015-07-13 03:51:24 +03:00
|
|
|
return (
|
2015-10-11 04:09:14 +03:00
|
|
|
<aside className={classes}>
|
|
|
|
{ collapseButton }
|
2015-07-16 18:32:11 +03:00
|
|
|
<IncomingCallBox />
|
2015-10-11 04:09:14 +03:00
|
|
|
<RoomList selectedRoom={this.props.selectedRoom} collapsed={this.state.collapsed}/>
|
2015-07-21 06:11:24 +03:00
|
|
|
<BottomLeftMenu />
|
2015-08-10 17:17:15 +03:00
|
|
|
</aside>
|
2015-07-13 03:51:24 +03:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|