import React, { PropTypes } from 'react'; import { Link } from 'react-router'; import { connect } from 'react-redux'; import FA from 'react-fontawesome'; import PureComponent from 'react-pure-render/component'; import { Panel } from 'react-bootstrap'; import classnames from 'classnames'; import { updateCurrentChallenge } from '../../redux/actions'; const dispatchActions = { updateCurrentChallenge }; export class Block extends PureComponent { static displayName = 'Block'; static propTypes = { title: PropTypes.string, time: PropTypes.string, challenges: PropTypes.array, updateCurrentChallenge: PropTypes.func }; renderChallenges(challenges, updateCurrentChallenge) { if (!Array.isArray(challenges) || !challenges.length) { return
{ title } { isRequired ? * : '' }
); } return (updateCurrentChallenge(challenge) }> { title } complete { isRequired ? * : '' }
); }); } render() { const { title, time, challenges, updateCurrentChallenge } = this.props; return (