user-polls refactor

This commit is contained in:
Ramón Souza 2021-12-06 19:01:13 +00:00
parent 67f4e44405
commit b00cc9ea90
2 changed files with 28 additions and 2 deletions

View File

@ -6,7 +6,7 @@ import UserMessages from './user-messages/container';
import UserNotesContainer from './user-notes/container';
import UserCaptionsContainer from './user-captions/container';
import WaitingUsersContainer from './waiting-users/container';
import UserPolls from './user-polls/component';
import UserPollsContainer from './user-polls/container';
import BreakoutRoomItem from './breakout-room/component';
const propTypes = {
@ -37,7 +37,7 @@ class UserContent extends PureComponent {
? (
<WaitingUsersContainer {...{ pendingUsers }} />
) : null}
<UserPolls isPresenter={currentUser.presenter} />
<UserPollsContainer isPresenter={currentUser.presenter} />
<BreakoutRoomItem isPresenter={currentUser.presenter} />
<UserParticipantsContainer />
</Styled.Content>

View File

@ -0,0 +1,26 @@
import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import UserPolls from './component';
import { layoutSelectInput, layoutDispatch } from '../../../layout/context';
const UserPollsContainer = (props) => {
const sidebarContent = layoutSelectInput((i) => i.sidebarContent);
const { sidebarContentPanel } = sidebarContent;
const layoutContextDispatch = layoutDispatch();
return (
<UserPolls
{...{
sidebarContentPanel,
layoutContextDispatch,
...props,
}}
/>
);
};
export default withTracker(({ isPresenter }) => ({
isPresenter,
pollIsOpen: Session.equals('isPollOpen', true),
forcePollOpen: Session.equals('forcePollOpen', true),
}))(UserPollsContainer);