diff --git a/src/skins/vector/views/organisms/MemberList.js b/src/skins/vector/views/organisms/MemberList.js index b525c6be..06aa3ba6 100644 --- a/src/skins/vector/views/organisms/MemberList.js +++ b/src/skins/vector/views/organisms/MemberList.js @@ -33,11 +33,14 @@ module.exports = React.createClass({ return { editing: false }; }, - makeMemberTiles: function() { + makeMemberTiles: function(membership) { var MemberTile = sdk.getComponent("molecules.MemberTile"); var self = this; - return Object.keys(self.state.memberDict).map(function(userId) { + return Object.keys(self.state.memberDict).filter(function(userId) { + var m = self.state.memberDict[userId]; + return m.membership == membership; + }).map(function(userId) { var m = self.state.memberDict[userId]; return ( @@ -87,17 +90,32 @@ module.exports = React.createClass({ }, render: function() { + var invitedSection = null; + var invitedMemberTiles = this.makeMemberTiles('invite'); + if (invitedMemberTiles.length > 0) { + invitedSection = ( +
+

Invited

+
+ {invitedMemberTiles} +
+
+ ); + } return (
-

Members

-
- {this.makeMemberTiles()} - {this.inviteTile()} +
+

Members

+
+ {this.makeMemberTiles('join')} +
+ {invitedSection} + {this.inviteTile()}
);