Clean up container/component relationship
This commit is contained in:
parent
8b0a53b375
commit
993d29242e
22 changed files with 384 additions and 372 deletions
|
@ -13,38 +13,31 @@ export default class UserList extends PureComponent {
|
|||
listRef = el => { this.list = el; };
|
||||
|
||||
renderUser = ({ index, style, key }) => {
|
||||
const { users, tab, openPrivateChat, select } = this.props;
|
||||
const { users, onNickClick } = this.props;
|
||||
|
||||
return (
|
||||
<UserListItem
|
||||
key={key}
|
||||
user={users.get(index)}
|
||||
tab={tab}
|
||||
openPrivateChat={openPrivateChat}
|
||||
select={select}
|
||||
style={style}
|
||||
onClick={onNickClick}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { tab, showUserList } = this.props;
|
||||
const { users, showUserList } = this.props;
|
||||
const className = showUserList ? 'userlist off-canvas' : 'userlist';
|
||||
const style = {};
|
||||
|
||||
if (!tab.isChannel()) {
|
||||
style.display = 'none';
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={className} style={style}>
|
||||
<div className={className}>
|
||||
<AutoSizer disableWidth>
|
||||
{({ height }) => (
|
||||
<List
|
||||
ref={this.listRef}
|
||||
width={200}
|
||||
height={height - 20}
|
||||
rowCount={this.props.users.size}
|
||||
rowCount={users.size}
|
||||
rowHeight={24}
|
||||
rowRenderer={this.renderUser}
|
||||
className="rvlist-users"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue