2016-05-20 02:22:56 +08:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import styles from './styles.scss';
|
|
|
|
import { Link } from 'react-router';
|
|
|
|
import UserListItem from './user-list-item/component.jsx';
|
|
|
|
import ChatListItem from './chat-list-item/component.jsx';
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
|
|
|
|
export default class UserList extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className={styles.userList}>
|
2016-05-26 03:29:22 +08:00
|
|
|
{this.renderHeader()}
|
|
|
|
{this.renderContent()}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
renderHeader() {
|
|
|
|
return (
|
|
|
|
<div className={styles.header}>
|
|
|
|
<h2 className={styles.headerTitle}>
|
|
|
|
<FormattedMessage
|
|
|
|
id="app.userlist.participantsTitle"
|
|
|
|
description="Title for the Header"
|
|
|
|
defaultMessage="Participants"
|
|
|
|
/>
|
|
|
|
</h2>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
2016-05-20 02:22:56 +08:00
|
|
|
|
2016-05-26 03:29:22 +08:00
|
|
|
renderContent() {
|
|
|
|
return (
|
|
|
|
<div className={styles.content}>
|
|
|
|
{this.renderMessages()}
|
|
|
|
{this.renderParticipants()}
|
2016-05-20 02:22:56 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2016-05-26 03:29:22 +08:00
|
|
|
|
|
|
|
renderMessages() {
|
|
|
|
return (
|
|
|
|
<div className={styles.messages}>
|
|
|
|
<h3 className={styles.smallTitle}>
|
|
|
|
<FormattedMessage
|
|
|
|
id="app.userlist.messagesTitle"
|
2016-06-01 04:25:42 +08:00
|
|
|
description="Title for the messages list"
|
2016-05-26 03:29:22 +08:00
|
|
|
defaultMessage="Messages"
|
|
|
|
/>
|
|
|
|
</h3>
|
|
|
|
<ul className={styles.chatsList} tabIndex="1">
|
|
|
|
<ChatListItem />
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
renderParticipants() {
|
|
|
|
return (
|
|
|
|
<div className={styles.participants}>
|
|
|
|
<h3 className={styles.smallTitle}>
|
|
|
|
<FormattedMessage
|
|
|
|
id="app.userlist.participantsTitle"
|
|
|
|
description="Title for the Participants list"
|
|
|
|
defaultMessage="Participants"
|
|
|
|
/>
|
|
|
|
({this.props.users.length})
|
|
|
|
</h3>
|
2016-06-01 04:25:42 +08:00
|
|
|
<div className={styles.scrollableList}>
|
|
|
|
<ul className={styles.participantsList} tabIndex="1">
|
|
|
|
{this.props.users.map(user => <UserListItem accessibilityLabel={'Status abc'} accessible={true} key={user.id} user={user}/>)}
|
|
|
|
</ul>
|
|
|
|
</div>
|
2016-05-26 03:29:22 +08:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
2016-05-20 02:22:56 +08:00
|
|
|
}
|