37 lines
1.3 KiB
JavaScript
37 lines
1.3 KiB
JavaScript
import React from 'react';
|
|
import SidebarContent from './component';
|
|
import { layoutSelectInput, layoutSelectOutput, layoutDispatch } from '../layout/context';
|
|
import { useSubscription } from '@apollo/client';
|
|
import {
|
|
CURRENT_PRESENTATION_PAGE_SUBSCRIPTION,
|
|
} from '/imports/ui/components/whiteboard/queries';
|
|
import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser';
|
|
|
|
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,
|
|
}));
|
|
const amIPresenter = currentUserData?.presenter;
|
|
|
|
const { data: presentationPageData } = useSubscription(CURRENT_PRESENTATION_PAGE_SUBSCRIPTION);
|
|
const presentationPage = presentationPageData?.pres_page_curr[0] || {};
|
|
|
|
const currentSlideId = presentationPage?.pageId;
|
|
|
|
return (
|
|
<SidebarContent
|
|
{...sidebarContentOutput}
|
|
contextDispatch={layoutContextDispatch}
|
|
sidebarContentPanel={sidebarContentPanel}
|
|
amIPresenter={amIPresenter}
|
|
currentSlideId={currentSlideId}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default SidebarContentContainer;
|