bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/user-list/container.jsx
Anton Georgiev 980a6490ec
Merge pull request #4832 from KDSBrowne/x.0.3-fix-console-warnings
Fix Invalid prop 'children[2]' supplied to `DropdownList`
2018-01-09 13:28:17 -02:00

86 lines
2.5 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { withTracker } from 'meteor/react-meteor-data';
import { meetingIsBreakout } from '/imports/ui/components/app/service';
import Meetings from '/imports/api/meetings';
import Service from './service';
import UserList from './component';
const propTypes = {
openChats: PropTypes.arrayOf(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,
};
const UserListContainer = (props) => {
const {
users,
currentUser,
openChats,
isBreakoutRoom,
meeting,
getAvailableActions,
normalizeEmojiName,
isMeetingLocked,
isPublicChat,
setEmojiStatus,
assignPresenter,
kickUser,
toggleVoice,
changeRole,
roving,
} = props;
return (
<UserList
users={users}
meeting={meeting}
currentUser={currentUser}
openChats={openChats}
isBreakoutRoom={isBreakoutRoom}
setEmojiStatus={setEmojiStatus}
assignPresenter={assignPresenter}
kickUser={kickUser}
toggleVoice={toggleVoice}
changeRole={changeRole}
getAvailableActions={getAvailableActions}
normalizeEmojiName={normalizeEmojiName}
isMeetingLocked={isMeetingLocked}
isPublicChat={isPublicChat}
roving={roving}
/>
);
};
UserListContainer.propTypes = propTypes;
export default withTracker(({ params }) => ({
users: Service.getUsers(),
meeting: Meetings.findOne({}),
currentUser: Service.getCurrentUser(),
openChats: Service.getOpenChats(params.chatID),
isBreakoutRoom: meetingIsBreakout(),
getAvailableActions: Service.getAvailableActions,
normalizeEmojiName: Service.normalizeEmojiName,
isMeetingLocked: Service.isMeetingLocked,
isPublicChat: Service.isPublicChat,
setEmojiStatus: Service.setEmojiStatus,
assignPresenter: Service.assignPresenter,
kickUser: Service.kickUser,
toggleVoice: Service.toggleVoice,
changeRole: Service.changeRole,
roving: Service.roving,
}))(UserListContainer);