2018-11-23 22:14:48 +08:00
|
|
|
import React, { PureComponent } from 'react';
|
2017-08-24 00:29:21 +08:00
|
|
|
import { injectIntl } from 'react-intl';
|
2017-06-04 10:40:14 +08:00
|
|
|
import PropTypes from 'prop-types';
|
2017-09-26 07:45:44 +08:00
|
|
|
import injectWbResizeEvent from '/imports/ui/components/presentation/resize-wrapper/component';
|
2018-01-08 14:17:18 +08:00
|
|
|
import { styles } from './styles';
|
2018-03-21 03:35:28 +08:00
|
|
|
import CustomLogo from './custom-logo/component';
|
2018-10-24 22:17:13 +08:00
|
|
|
import UserContentContainer from './user-list-content/container';
|
2016-05-20 02:22:56 +08:00
|
|
|
|
2016-06-29 03:52:03 +08:00
|
|
|
const propTypes = {
|
2019-01-14 21:23:35 +08:00
|
|
|
activeChats: PropTypes.arrayOf(String).isRequired,
|
2017-07-28 21:43:39 +08:00
|
|
|
compact: PropTypes.bool,
|
2017-09-29 02:19:57 +08:00
|
|
|
intl: PropTypes.shape({
|
|
|
|
formatMessage: PropTypes.func.isRequired,
|
|
|
|
}).isRequired,
|
2017-09-22 02:40:18 +08:00
|
|
|
currentUser: PropTypes.shape({}).isRequired,
|
2018-11-23 22:14:48 +08:00
|
|
|
CustomLogoUrl: PropTypes.string.isRequired,
|
|
|
|
handleEmojiChange: PropTypes.func.isRequired,
|
|
|
|
getUsersId: PropTypes.func.isRequired,
|
2017-08-24 00:29:21 +08:00
|
|
|
isBreakoutRoom: PropTypes.bool,
|
|
|
|
getAvailableActions: PropTypes.func.isRequired,
|
|
|
|
normalizeEmojiName: PropTypes.func.isRequired,
|
2017-09-22 02:40:18 +08:00
|
|
|
isMeetingLocked: PropTypes.func.isRequired,
|
2017-09-22 22:24:24 +08:00
|
|
|
isPublicChat: PropTypes.func.isRequired,
|
2017-09-29 02:19:57 +08:00
|
|
|
setEmojiStatus: PropTypes.func.isRequired,
|
|
|
|
assignPresenter: PropTypes.func.isRequired,
|
2018-01-10 06:28:48 +08:00
|
|
|
removeUser: PropTypes.func.isRequired,
|
2017-09-29 02:19:57 +08:00
|
|
|
toggleVoice: PropTypes.func.isRequired,
|
2018-09-29 05:32:52 +08:00
|
|
|
muteAllUsers: PropTypes.func.isRequired,
|
|
|
|
muteAllExceptPresenter: PropTypes.func.isRequired,
|
2017-09-29 02:19:57 +08:00
|
|
|
changeRole: PropTypes.func.isRequired,
|
2017-12-07 00:53:16 +08:00
|
|
|
roving: PropTypes.func.isRequired,
|
2018-07-26 22:56:26 +08:00
|
|
|
getGroupChatPrivate: PropTypes.func.isRequired,
|
2018-09-14 02:09:30 +08:00
|
|
|
showBranding: PropTypes.bool.isRequired,
|
2019-01-29 23:17:09 +08:00
|
|
|
toggleUserLock: PropTypes.func.isRequired,
|
2016-06-29 03:52:03 +08:00
|
|
|
};
|
2018-09-14 02:09:30 +08:00
|
|
|
|
2016-06-29 03:52:03 +08:00
|
|
|
const defaultProps = {
|
2017-07-28 21:43:39 +08:00
|
|
|
compact: false,
|
2017-08-24 00:29:21 +08:00
|
|
|
isBreakoutRoom: false,
|
2016-06-29 03:52:03 +08:00
|
|
|
};
|
|
|
|
|
2018-11-23 22:14:48 +08:00
|
|
|
class UserList extends PureComponent {
|
2017-07-28 21:43:39 +08:00
|
|
|
render() {
|
2018-03-21 03:35:28 +08:00
|
|
|
const {
|
|
|
|
intl,
|
2019-01-14 21:23:35 +08:00
|
|
|
activeChats,
|
2018-03-21 03:35:28 +08:00
|
|
|
compact,
|
|
|
|
currentUser,
|
|
|
|
isBreakoutRoom,
|
|
|
|
setEmojiStatus,
|
|
|
|
assignPresenter,
|
|
|
|
removeUser,
|
|
|
|
toggleVoice,
|
2018-09-29 05:32:52 +08:00
|
|
|
muteAllUsers,
|
|
|
|
muteAllExceptPresenter,
|
2018-03-21 03:35:28 +08:00
|
|
|
changeRole,
|
|
|
|
getAvailableActions,
|
|
|
|
normalizeEmojiName,
|
|
|
|
isMeetingLocked,
|
|
|
|
isPublicChat,
|
|
|
|
roving,
|
|
|
|
CustomLogoUrl,
|
2018-07-26 22:56:26 +08:00
|
|
|
getGroupChatPrivate,
|
2018-07-03 09:48:28 +08:00
|
|
|
handleEmojiChange,
|
2018-07-12 04:08:22 +08:00
|
|
|
getEmojiList,
|
|
|
|
getEmoji,
|
2018-09-14 02:09:30 +08:00
|
|
|
showBranding,
|
2018-10-02 21:48:12 +08:00
|
|
|
hasBreakoutRoom,
|
2018-11-23 22:14:48 +08:00
|
|
|
getUsersId,
|
2019-01-15 00:58:01 +08:00
|
|
|
hasPrivateChatBetweenUsers,
|
2019-01-29 23:17:09 +08:00
|
|
|
toggleUserLock,
|
2018-03-21 03:35:28 +08:00
|
|
|
} = this.props;
|
|
|
|
|
2017-07-28 21:43:39 +08:00
|
|
|
return (
|
|
|
|
<div className={styles.userList}>
|
2018-03-21 03:35:28 +08:00
|
|
|
{
|
2018-09-14 02:09:30 +08:00
|
|
|
showBranding
|
2019-01-14 21:23:35 +08:00
|
|
|
&& !compact
|
|
|
|
&& CustomLogoUrl
|
|
|
|
? <CustomLogo CustomLogoUrl={CustomLogoUrl} /> : null
|
2018-03-21 03:35:28 +08:00
|
|
|
}
|
2018-10-24 22:17:13 +08:00
|
|
|
{<UserContentContainer
|
2018-03-21 03:35:28 +08:00
|
|
|
{...{
|
2019-01-14 21:23:35 +08:00
|
|
|
intl,
|
|
|
|
activeChats,
|
|
|
|
compact,
|
|
|
|
currentUser,
|
|
|
|
isBreakoutRoom,
|
|
|
|
setEmojiStatus,
|
|
|
|
assignPresenter,
|
|
|
|
removeUser,
|
|
|
|
toggleVoice,
|
|
|
|
muteAllUsers,
|
|
|
|
muteAllExceptPresenter,
|
|
|
|
changeRole,
|
|
|
|
getAvailableActions,
|
|
|
|
normalizeEmojiName,
|
|
|
|
isMeetingLocked,
|
|
|
|
isPublicChat,
|
|
|
|
roving,
|
|
|
|
getGroupChatPrivate,
|
|
|
|
handleEmojiChange,
|
|
|
|
getEmojiList,
|
|
|
|
getEmoji,
|
|
|
|
hasBreakoutRoom,
|
|
|
|
getUsersId,
|
2019-01-18 02:53:32 +08:00
|
|
|
hasPrivateChatBetweenUsers,
|
2019-01-29 23:17:09 +08:00
|
|
|
toggleUserLock,
|
2019-01-14 21:23:35 +08:00
|
|
|
}
|
|
|
|
}
|
2017-09-22 02:40:18 +08:00
|
|
|
/>}
|
2017-07-28 21:43:39 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2016-05-20 02:22:56 +08:00
|
|
|
}
|
2016-06-02 21:00:57 +08:00
|
|
|
|
2016-06-29 03:52:03 +08:00
|
|
|
UserList.propTypes = propTypes;
|
2017-07-28 21:43:39 +08:00
|
|
|
UserList.defaultProps = defaultProps;
|
|
|
|
|
2018-10-04 00:14:10 +08:00
|
|
|
export default injectWbResizeEvent(injectIntl(UserList));
|