3bc40df230
* Add: useDeduplicatedSubscription hook * Fix: TS error * Add: components using useDeduplicatedSubscription * Change: Move to useDeduplicatedSubscription * Change: unsubscribe logic to own useEffect * Change: remove file import over package * Fix: TS errors * Fix: private chat not loading * Change: revert changes on queries * Fix: eslint error * Remove: html-webpack-plugin package * Fix: external video * Add: comment about the stringToHash function * Fix: video player showing tools over presentation
43 lines
1.5 KiB
JavaScript
43 lines
1.5 KiB
JavaScript
import React from 'react';
|
|
import SidebarContent from './component';
|
|
import { layoutSelectInput, layoutSelectOutput, layoutDispatch } from '../layout/context';
|
|
|
|
import {
|
|
CURRENT_PRESENTATION_PAGE_SUBSCRIPTION,
|
|
} from '/imports/ui/components/whiteboard/queries';
|
|
import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser';
|
|
import useDeduplicatedSubscription from '../../core/hooks/useDeduplicatedSubscription';
|
|
|
|
const SidebarContentContainer = () => {
|
|
const sidebarContentInput = layoutSelectInput((i) => i.sidebarContent);
|
|
const sidebarContentOutput = layoutSelectOutput((i) => i.sidebarContent);
|
|
const layoutContextDispatch = layoutDispatch();
|
|
const { sidebarContentPanel } = sidebarContentInput;
|
|
const { data: currentUserData } = useCurrentUser((user) => ({
|
|
presenter: user.presenter,
|
|
isModerator: user.isModerator,
|
|
}));
|
|
const amIPresenter = currentUserData?.presenter;
|
|
const amIModerator = currentUserData?.isModerator;
|
|
|
|
const { data: presentationPageData } = useDeduplicatedSubscription(
|
|
CURRENT_PRESENTATION_PAGE_SUBSCRIPTION,
|
|
);
|
|
const presentationPage = presentationPageData?.pres_page_curr[0] || {};
|
|
|
|
const currentSlideId = presentationPage?.pageId;
|
|
|
|
return (
|
|
<SidebarContent
|
|
{...sidebarContentOutput}
|
|
contextDispatch={layoutContextDispatch}
|
|
sidebarContentPanel={sidebarContentPanel}
|
|
amIPresenter={amIPresenter}
|
|
amIModerator={amIModerator}
|
|
currentSlideId={currentSlideId}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default SidebarContentContainer;
|