bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/sidebar-content/container.jsx
2022-08-31 10:33:55 -03:00

29 lines
1.0 KiB
JavaScript

import React, { useContext } from 'react';
import SidebarContent from './component';
import { layoutSelectInput, layoutSelectOutput, layoutDispatch } from '../layout/context';
import { UsersContext } from '../components-data/users-context/context';
import Auth from '/imports/ui/services/auth';
const SidebarContentContainer = () => {
const sidebarContentInput = layoutSelectInput((i) => i.sidebarContent);
const sidebarContentOutput = layoutSelectOutput((i) => i.sidebarContent);
const layoutContextDispatch = layoutDispatch();
const { sidebarContentPanel } = sidebarContentInput;
const usingUsersContext = useContext(UsersContext);
const { users } = usingUsersContext;
const amIPresenter = users[Auth.meetingID][Auth.userID].presenter;
if (sidebarContentOutput.display === false) return null;
return (
<SidebarContent
{...sidebarContentOutput}
contextDispatch={layoutContextDispatch}
sidebarContentPanel={sidebarContentPanel}
amIPresenter={amIPresenter}
/>
);
};
export default SidebarContentContainer;