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

26 lines
582 B
React
Raw Normal View History

2016-05-06 02:50:18 +08:00
import React from 'react';
import PropTypes from 'prop-types';
import { withTracker } from 'meteor/react-meteor-data';
2017-10-06 20:50:01 +08:00
import PollingService from './service';
import PollingComponent from './component';
2016-05-06 02:50:18 +08:00
const propTypes = {
pollExists: PropTypes.bool.isRequired,
2017-10-06 20:50:01 +08:00
};
const PollingContainer = ({ pollExists, ...props }) => {
if (pollExists) {
return (
<PollingComponent {...props} />
);
}
return null;
};
PollingContainer.propTypes = propTypes;
export default withTracker(() => {
2016-05-06 02:50:18 +08:00
const data = PollingService.mapPolls();
return data;
})(PollingContainer);