bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/nav-bar/leave-meeting-button/container.jsx
André Castro b8f3a090bd
Fix: Errors and warnings (#20975)
* bad set state (actionsBarContainer)

* bad set state (appContainer)

* isMobile should be ismobile warning

* bad setState (notes)

* bad setState (user-notes)

* bad setState (user-participants-title)

* bad setState (webCamContainer)

* bad setState (PresentationMenuContainer)

* fix webCams not working issue

* fix userList user counter not working issue

* fix TS lint

* fix TS lint

* fix TS lint

* Later changes
2024-09-10 16:10:28 -04:00

52 lines
1.6 KiB
JavaScript

import React from 'react';
import { useMutation, useReactiveVar } from '@apollo/client';
import LeaveMeetingButton from './component';
import { layoutSelectInput, layoutSelect } from '../../layout/context';
import { SMALL_VIEWPORT_BREAKPOINT } from '../../layout/enums';
import { USER_LEAVE_MEETING } from '/imports/ui/core/graphql/mutations/userMutations';
import { useStorageKey } from '/imports/ui/services/storage/hooks';
import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser';
import connectionStatus from '/imports/ui/core/graphql/singletons/connectionStatus';
import useMeeting from '/imports/ui/core/hooks/useMeeting';
import deviceInfo from '/imports/utils/deviceInfo';
const LeaveMeetingButtonContainer = (props) => {
const {
data: currentUser,
} = useCurrentUser((u) => ({
isModerator: u.isModerator,
}));
const {
data: meeting,
} = useMeeting((m) => ({
isBreakout: m.isBreakout,
}));
const { isMobile } = deviceInfo;
const isRTL = layoutSelect((i) => i.isRTL);
const [userLeaveMeeting] = useMutation(USER_LEAVE_MEETING);
const isDropdownOpen = useStorageKey('dropdownOpen');
const connected = useReactiveVar(connectionStatus.getConnectedStatusVar());
const amIModerator = currentUser?.isModerator;
const isBreakoutRoom = meeting?.isBreakout;
return (
<LeaveMeetingButton {...
{
ismobile: isMobile,
isRTL,
userLeaveMeeting,
isDropdownOpen,
amIModerator,
connected,
isBreakoutRoom,
...props,
}
}
/>
);
};
export default LeaveMeetingButtonContainer;