mirror of https://github.com/vector-im/riot-web
Add member list (that doesn't really update much yet)
parent
e77e9b7704
commit
0424ef07b3
|
@ -9,14 +9,14 @@
|
||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mx_RoomView ul {
|
.mx_RoomView .mx_RoomView_MessageList {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 35px;
|
top: 35px;
|
||||||
bottom: 40px;
|
bottom: 40px;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
right: 0px;
|
right: 150px;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,21 @@
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mx_RoomView .mx_MemberList {
|
||||||
|
position: absolute;
|
||||||
|
top: 35px;
|
||||||
|
bottom: 40px;
|
||||||
|
right: 0px;
|
||||||
|
width: 150px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mx_RoomView .mx_MemberList ul {
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.mx_RoomView .mx_MessageComposer {
|
.mx_RoomView .mx_MessageComposer {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 5px;
|
bottom: 5px;
|
||||||
|
|
|
@ -37,6 +37,8 @@ require('./views/molecules/RoomHeader');
|
||||||
require('./views/molecules/MessageComposer');
|
require('./views/molecules/MessageComposer');
|
||||||
require('./views/molecules/ProgressBar');
|
require('./views/molecules/ProgressBar');
|
||||||
require('./views/molecules/ServerConfig');
|
require('./views/molecules/ServerConfig');
|
||||||
|
require('./views/organisms/MemberList');
|
||||||
|
require('./views/molecules/MemberTile');
|
||||||
require('./views/organisms/RoomList');
|
require('./views/organisms/RoomList');
|
||||||
require('./views/organisms/RoomView');
|
require('./views/organisms/RoomView');
|
||||||
require('./views/templates/Login');
|
require('./views/templates/Login');
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
var dis = require("../../dispatcher");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
onClick: function() {
|
||||||
|
dis.dispatch({
|
||||||
|
action: 'view_user',
|
||||||
|
room_id: this.props.member.userId
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
|
@ -0,0 +1,30 @@
|
||||||
|
var React = require("react");
|
||||||
|
var MatrixClientPeg = require("../../MatrixClientPeg");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
componentWillMount: function() {
|
||||||
|
var cli = MatrixClientPeg.get();
|
||||||
|
cli.on("RoomState.members", this.onRoomStateMember);
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
memberDict: cli.getRoom(this.props.roomId).currentState.members
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
componentWillUnmount: function() {
|
||||||
|
if (MatrixClientPeg.get()) {
|
||||||
|
MatrixClientPeg.get().removeListener("RoomState.members", this.onRoomStateMember);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Remember to set 'key' on a MemberList to the ID of the room it's for
|
||||||
|
/*componentWillReceiveProps: function(newProps) {
|
||||||
|
},*/
|
||||||
|
|
||||||
|
onRoomStateMember: function(ev, state, member) {
|
||||||
|
this.setState({
|
||||||
|
memberDict: cli.getRoom(this.props.roomId).currentState.members
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
var React = require('react');
|
||||||
|
|
||||||
|
var MemberTileController = require("../../controllers/molecules/MemberTile");
|
||||||
|
|
||||||
|
module.exports = React.createClass({
|
||||||
|
displayName: 'MemberTile',
|
||||||
|
mixins: [MemberTileController],
|
||||||
|
render: function() {
|
||||||
|
return (
|
||||||
|
<div className="mx_MemberTile">
|
||||||
|
<div className="mx_MemberTile_name">{this.props.member.name}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
|
@ -0,0 +1,39 @@
|
||||||
|
var React = require('react');
|
||||||
|
|
||||||
|
var MemberListController = require("../../controllers/organisms/MemberList");
|
||||||
|
|
||||||
|
var ComponentBroker = require('../../ComponentBroker');
|
||||||
|
|
||||||
|
var MemberTile = ComponentBroker.get("molecules/MemberTile");
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = React.createClass({
|
||||||
|
displayName: 'MemberList',
|
||||||
|
mixins: [MemberListController],
|
||||||
|
|
||||||
|
makeMemberTiles: function() {
|
||||||
|
var that = this;
|
||||||
|
return Object.keys(that.state.memberDict).map(function(userId) {
|
||||||
|
var m = that.state.memberDict[userId];
|
||||||
|
return (
|
||||||
|
<li>
|
||||||
|
<MemberTile
|
||||||
|
member={m}
|
||||||
|
key={userId}
|
||||||
|
/>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
render: function() {
|
||||||
|
return (
|
||||||
|
<div className="mx_MemberList">
|
||||||
|
<ul>
|
||||||
|
{this.makeMemberTiles()}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
|
@ -4,6 +4,7 @@ var ComponentBroker = require('../../ComponentBroker');
|
||||||
|
|
||||||
var MessageTile = ComponentBroker.get('molecules/MessageTile');
|
var MessageTile = ComponentBroker.get('molecules/MessageTile');
|
||||||
var RoomHeader = ComponentBroker.get('molecules/RoomHeader');
|
var RoomHeader = ComponentBroker.get('molecules/RoomHeader');
|
||||||
|
var MemberList = ComponentBroker.get('organisms/MemberList');
|
||||||
var MessageComposer = ComponentBroker.get('molecules/MessageComposer');
|
var MessageComposer = ComponentBroker.get('molecules/MessageComposer');
|
||||||
|
|
||||||
var RoomViewController = require("../../controllers/organisms/RoomView");
|
var RoomViewController = require("../../controllers/organisms/RoomView");
|
||||||
|
@ -25,9 +26,12 @@ module.exports = React.createClass({
|
||||||
return (
|
return (
|
||||||
<div className="mx_RoomView">
|
<div className="mx_RoomView">
|
||||||
<RoomHeader room={this.state.room} />
|
<RoomHeader room={this.state.room} />
|
||||||
<ul ref="messageList">
|
<div className="mx_RoomView_HSplit">
|
||||||
{this.getMessageTiles()}
|
<ul className="mx_RoomView_MessageList" ref="messageList">
|
||||||
</ul>
|
{this.getMessageTiles()}
|
||||||
|
</ul>
|
||||||
|
<MemberList roomId={this.props.roomId} key={this.props.roomId} />
|
||||||
|
</div>
|
||||||
<MessageComposer roomId={this.props.roomId} />
|
<MessageComposer roomId={this.props.roomId} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue