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

37 lines
1.2 KiB
React
Raw Normal View History

import React from 'react';
import { makeCall } from '/imports/ui/services/api';
2018-09-24 06:20:20 +08:00
import { withTracker } from 'meteor/react-meteor-data';
import Auth from '/imports/ui/services/auth';
import Presentations from '/imports/api/presentations';
import PresentationAreaService from '/imports/ui/components/presentation/service';
import Poll from './component';
import Service from './service';
2018-11-23 12:08:48 +08:00
const PollContainer = ({ ...props }) => <Poll {...props} />;
2018-09-24 06:20:20 +08:00
export default withTracker(({ }) => {
2018-10-29 23:27:50 +08:00
Meteor.subscribe('current-poll', Auth.meetingID);
const currentPresentation = Presentations.findOne({
current: true,
});
const currentSlide = PresentationAreaService.getCurrentSlide(currentPresentation.podId);
2018-09-24 06:20:20 +08:00
const startPoll = type => makeCall('startPoll', type, currentSlide.id);
const startCustomPoll = (type, answers) => makeCall('startPoll', type, currentSlide.id, answers);
return {
currentSlide,
currentUser: Service.currentUser(),
pollTypes: Service.pollTypes,
2018-09-24 06:20:20 +08:00
startPoll,
startCustomPoll,
stopPoll: Service.stopPoll,
publishPoll: Service.publishPoll,
currentPoll: Service.currentPoll(),
getUser: Service.getUser,
2018-09-24 06:20:20 +08:00
};
})(PollContainer);