waiting users refactor

This commit is contained in:
Ramón Souza 2021-12-06 18:03:48 +00:00
parent a5dd3fd7be
commit 67f4e44405
3 changed files with 28 additions and 4 deletions

View File

@ -5,7 +5,7 @@ import UserParticipantsContainer from './user-participants/container';
import UserMessages from './user-messages/container';
import UserNotesContainer from './user-notes/container';
import UserCaptionsContainer from './user-captions/container';
import WaitingUsers from './waiting-users/component';
import WaitingUsersContainer from './waiting-users/container';
import UserPolls from './user-polls/component';
import BreakoutRoomItem from './breakout-room/component';
@ -33,7 +33,10 @@ class UserContent extends PureComponent {
{CHAT_ENABLED ? <UserMessages /> : null}
{currentUser.role === ROLE_MODERATOR ? <UserCaptionsContainer /> : null}
<UserNotesContainer />
{showWaitingRoom && currentUser.role === ROLE_MODERATOR ? <WaitingUsers /> : null}
{showWaitingRoom && currentUser.role === ROLE_MODERATOR
? (
<WaitingUsersContainer {...{ pendingUsers }} />
) : null}
<UserPolls isPresenter={currentUser.presenter} />
<BreakoutRoomItem isPresenter={currentUser.presenter} />
<UserParticipantsContainer />

View File

@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { defineMessages } from 'react-intl';
import { defineMessages, injectIntl } from 'react-intl';
import Icon from '/imports/ui/components/icon/component';
import Styled from './styles';
import { ACTIONS, PANELS } from '../../../layout/enums';
@ -75,4 +75,4 @@ const WaitingUsers = ({
WaitingUsers.propTypes = propTypes;
export default WaitingUsers;
export default injectIntl(WaitingUsers);

View File

@ -0,0 +1,21 @@
import React from 'react';
import WaitingUsers from './component';
import { layoutSelectInput, layoutDispatch } from '/imports/ui/components/layout/context';
const WaitingUsersContainer = ({ pendingUsers }) => {
const sidebarContent = layoutSelectInput((i) => i.sidebarContent);
const layoutContextDispatch = layoutDispatch();
const { sidebarContentPanel } = sidebarContent;
return (
<WaitingUsers
{...{
pendingUsers,
sidebarContentPanel,
layoutContextDispatch,
}}
/>
);
};
export default WaitingUsersContainer;