import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import ProgressBar from '../../../components/progress_bar'; import { funding } from '../../../initial_state'; class FundingPanel extends ImmutablePureComponent { render() { const { goal, goal_text } = this.props; const goal_reached = funding.amount >= goal; let ratio_text; if (goal_reached) { ratio_text = <>${Math.floor(goal/100)} per month— reached!>; } else { ratio_text = <>${Math.floor(funding.amount/100)} out of ${Math.floor(goal/100)} per month>; } return (