2016-05-06 02:50:18 +08:00
|
|
|
import React from 'react';
|
2016-05-20 21:46:30 +08:00
|
|
|
import PollingService from './service';
|
2016-05-06 02:50:18 +08:00
|
|
|
import { createContainer } from 'meteor/react-meteor-data';
|
2016-05-20 21:46:30 +08:00
|
|
|
import PollingComponent from './component';
|
2016-05-06 02:50:18 +08:00
|
|
|
|
|
|
|
class PollingContainer extends React.Component {
|
|
|
|
render() {
|
|
|
|
if (this.props.pollExists) {
|
|
|
|
return <PollingComponent poll={this.props.poll} handleVote={this.props.handleVote} />;
|
|
|
|
} else {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default createContainer(() => {
|
|
|
|
const data = PollingService.mapPolls();
|
|
|
|
return data;
|
|
|
|
}, PollingContainer);
|