2017-07-12 21:18:26 +08:00
|
|
|
import React from 'react';
|
2017-12-07 00:53:16 +08:00
|
|
|
import PropTypes from 'prop-types';
|
2016-05-20 02:22:56 +08:00
|
|
|
import { createContainer } from 'meteor/react-meteor-data';
|
2017-03-16 00:21:26 +08:00
|
|
|
import { meetingIsBreakout } from '/imports/ui/components/app/service';
|
2017-10-12 10:00:28 +08:00
|
|
|
import Meetings from '/imports/api/meetings';
|
2017-07-12 21:18:26 +08:00
|
|
|
import Service from './service';
|
|
|
|
import UserList from './component';
|
2016-05-20 02:22:56 +08:00
|
|
|
|
2017-12-07 00:53:16 +08:00
|
|
|
const propTypes = {
|
|
|
|
openChats: PropTypes.arrayOf(String).isRequired,
|
|
|
|
openChat: PropTypes.string.isRequired,
|
|
|
|
users: PropTypes.arrayOf(Object).isRequired,
|
|
|
|
currentUser: PropTypes.shape({}).isRequired,
|
|
|
|
meeting: PropTypes.shape({}).isRequired,
|
|
|
|
isBreakoutRoom: PropTypes.bool.isRequired,
|
|
|
|
getAvailableActions: PropTypes.func.isRequired,
|
|
|
|
normalizeEmojiName: PropTypes.func.isRequired,
|
|
|
|
isMeetingLocked: PropTypes.func.isRequired,
|
|
|
|
isPublicChat: PropTypes.func.isRequired,
|
|
|
|
setEmojiStatus: PropTypes.func.isRequired,
|
|
|
|
assignPresenter: PropTypes.func.isRequired,
|
|
|
|
kickUser: PropTypes.func.isRequired,
|
|
|
|
toggleVoice: PropTypes.func.isRequired,
|
|
|
|
changeRole: PropTypes.func.isRequired,
|
|
|
|
roving: PropTypes.func.isRequired,
|
|
|
|
userActions: PropTypes.func.isRequired,
|
|
|
|
children: PropTypes.Object,
|
|
|
|
};
|
|
|
|
|
|
|
|
const defaultProps = {
|
|
|
|
children: {},
|
|
|
|
};
|
|
|
|
|
2017-07-12 21:18:26 +08:00
|
|
|
const UserListContainer = (props) => {
|
|
|
|
const {
|
|
|
|
users,
|
|
|
|
currentUser,
|
|
|
|
openChats,
|
|
|
|
openChat,
|
|
|
|
userActions,
|
|
|
|
isBreakoutRoom,
|
|
|
|
children,
|
|
|
|
meeting,
|
2017-08-16 22:56:31 +08:00
|
|
|
getAvailableActions,
|
|
|
|
normalizeEmojiName,
|
2017-09-01 02:12:53 +08:00
|
|
|
isMeetingLocked,
|
2017-09-22 22:24:24 +08:00
|
|
|
isPublicChat,
|
2017-09-29 02:19:57 +08:00
|
|
|
setEmojiStatus,
|
|
|
|
assignPresenter,
|
|
|
|
kickUser,
|
|
|
|
toggleVoice,
|
|
|
|
changeRole,
|
2017-12-06 03:13:11 +08:00
|
|
|
roving,
|
2017-12-07 00:53:16 +08:00
|
|
|
} = props;
|
2016-05-20 02:22:56 +08:00
|
|
|
|
2017-07-12 21:18:26 +08:00
|
|
|
return (
|
|
|
|
<UserList
|
|
|
|
users={users}
|
|
|
|
meeting={meeting}
|
|
|
|
currentUser={currentUser}
|
|
|
|
openChats={openChats}
|
|
|
|
openChat={openChat}
|
|
|
|
isBreakoutRoom={isBreakoutRoom}
|
2017-09-29 02:19:57 +08:00
|
|
|
setEmojiStatus={setEmojiStatus}
|
|
|
|
assignPresenter={assignPresenter}
|
|
|
|
kickUser={kickUser}
|
|
|
|
toggleVoice={toggleVoice}
|
|
|
|
changeRole={changeRole}
|
2017-07-12 21:18:26 +08:00
|
|
|
userActions={userActions}
|
2017-08-16 22:56:31 +08:00
|
|
|
getAvailableActions={getAvailableActions}
|
|
|
|
normalizeEmojiName={normalizeEmojiName}
|
2017-09-01 02:12:53 +08:00
|
|
|
isMeetingLocked={isMeetingLocked}
|
2017-09-22 22:24:24 +08:00
|
|
|
isPublicChat={isPublicChat}
|
2017-12-06 03:13:11 +08:00
|
|
|
roving={roving}
|
2017-07-12 21:18:26 +08:00
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</UserList>
|
|
|
|
);
|
|
|
|
};
|
2016-05-20 02:22:56 +08:00
|
|
|
|
2017-12-07 00:53:16 +08:00
|
|
|
UserListContainer.propTypes = propTypes;
|
|
|
|
UserListContainer.defaultProps = defaultProps;
|
|
|
|
|
2016-06-28 21:10:20 +08:00
|
|
|
export default createContainer(({ params }) => ({
|
2016-06-07 00:45:30 +08:00
|
|
|
users: Service.getUsers(),
|
2017-05-16 03:26:03 +08:00
|
|
|
meeting: Meetings.findOne({}),
|
2016-06-28 21:10:20 +08:00
|
|
|
currentUser: Service.getCurrentUser(),
|
2016-06-30 22:45:19 +08:00
|
|
|
openChats: Service.getOpenChats(params.chatID),
|
|
|
|
openChat: params.chatID,
|
2016-06-28 21:10:20 +08:00
|
|
|
userActions: Service.userActions,
|
2017-03-16 02:03:58 +08:00
|
|
|
isBreakoutRoom: meetingIsBreakout(),
|
2017-08-16 22:56:31 +08:00
|
|
|
getAvailableActions: Service.getAvailableActions,
|
|
|
|
normalizeEmojiName: Service.normalizeEmojiName,
|
2017-09-07 02:32:29 +08:00
|
|
|
isMeetingLocked: Service.isMeetingLocked,
|
2017-09-22 22:24:24 +08:00
|
|
|
isPublicChat: Service.isPublicChat,
|
2017-09-29 02:19:57 +08:00
|
|
|
setEmojiStatus: Service.setEmojiStatus,
|
|
|
|
assignPresenter: Service.assignPresenter,
|
|
|
|
kickUser: Service.kickUser,
|
|
|
|
toggleVoice: Service.toggleVoice,
|
|
|
|
changeRole: Service.changeRole,
|
2017-12-06 03:13:11 +08:00
|
|
|
roving: Service.roving,
|
2016-06-07 00:45:30 +08:00
|
|
|
}), UserListContainer);
|