removal: remove withTracker from LockViewersContainer component

This commit is contained in:
João Victor 2024-05-16 11:04:26 -03:00
parent 5dabb59c48
commit 34b73b66d7

View File

@ -1,11 +1,9 @@
import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import Meetings from '/imports/api/meetings';
import Auth from '/imports/ui/services/auth';
import { useMutation } from '@apollo/client';
import LockViewersComponent from './component';
import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser';
import { SET_LOCK_SETTINGS_PROPS, SET_WEBCAM_ONLY_FOR_MODERATOR } from './mutations';
import useMeeting from '../../core/hooks/useMeeting';
const LockViewersContainer = (props) => {
const { data: currentUserData } = useCurrentUser((user) => ({
@ -41,17 +39,23 @@ const LockViewersContainer = (props) => {
});
};
const { setIsOpen } = props;
const closeModal = () => setIsOpen(false);
const { data: meeting } = useMeeting((m) => ({
lockSettings: m.lockSettings,
usersPolicies: m.usersPolicies,
}));
return amIModerator && (
<LockViewersComponent
updateWebcamsOnlyForModerator={updateWebcamsOnlyForModerator}
updateLockSettings={updateLockSettings}
closeModal={closeModal}
showToggleLabel={false}
meeting={meeting}
{...props}
/>
);
};
export default withTracker(({ setIsOpen }) => ({
closeModal: () => setIsOpen(false),
meeting: Meetings.findOne({ meetingId: Auth.meetingID }),
showToggleLabel: false,
}))(LockViewersContainer);
export default LockViewersContainer;