bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/container.jsx

41 lines
1.6 KiB
React
Raw Normal View History

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import { getSwapLayout, shouldEnableSwapLayout } from '/imports/ui/components/media/service';
import { notify } from '/imports/ui/services/notification';
2017-02-17 05:11:46 +08:00
import PresentationAreaService from './service';
import PresentationArea from './component';
import PresentationToolbarService from './presentation-toolbar/service';
2019-03-07 05:57:07 +08:00
const PresentationAreaContainer = ({ presentationPodIds, mountPresentationArea, ...props }) => (
mountPresentationArea && <PresentationArea {...props} />
);
2018-07-27 03:35:38 +08:00
export default withTracker(({ podId }) => {
const currentSlide = PresentationAreaService.getCurrentSlide(podId);
const presentationIsDownloadable = PresentationAreaService.isPresentationDownloadable(podId);
const layoutSwapped = getSwapLayout() && shouldEnableSwapLayout();
2019-08-02 01:50:39 +08:00
let slidePosition;
if (currentSlide) {
const {
presentationId,
id: slideId,
} = currentSlide;
slidePosition = PresentationAreaService.getSlidePosition(podId, presentationId, slideId);
}
2018-07-27 03:35:38 +08:00
return {
currentSlide,
slidePosition,
downloadPresentationUri: PresentationAreaService.downloadPresentationUri(podId),
userIsPresenter: PresentationAreaService.isPresenter(podId) && !layoutSwapped,
2019-03-07 05:57:07 +08:00
multiUser: PresentationAreaService.getMultiUserStatus(currentSlide && currentSlide.id)
&& !layoutSwapped,
presentationIsDownloadable,
2019-03-07 05:57:07 +08:00
mountPresentationArea: !!currentSlide,
currentPresentation: PresentationAreaService.getCurrentPresentation(podId),
notify,
zoomSlide: PresentationToolbarService.zoomSlide,
podId,
2018-07-27 03:35:38 +08:00
};
})(PresentationAreaContainer);