import React from 'react'; import moment from 'moment'; import { connect } from 'react-redux'; import { Link } from 'react-router-dom'; import { Icon, Tag } from 'antd'; import ExceptionPage from 'components/ExceptionPage'; import { fetchRfp } from 'modules/rfps/actions'; import { getRfp } from 'modules/rfps/selectors'; import { RFP } from 'types'; import { AppState } from 'store/reducers'; import Loader from 'components/Loader'; import Markdown from 'components/Markdown'; import ProposalCard from 'components/Proposals/ProposalCard'; import UnitDisplay from 'components/UnitDisplay'; import HeaderDetails from 'components/HeaderDetails'; import Like from 'components/Like'; import { RFP_STATUS } from 'api/constants'; import { formatUsd } from 'utils/formatters'; import './index.less'; interface OwnProps { rfpId: number; } interface StateProps { rfp: RFP | undefined; isFetchingRfps: AppState['rfps']['isFetchingRfps']; fetchRfpsError: AppState['rfps']['fetchRfpsError']; } interface DispatchProps { fetchRfp: typeof fetchRfp; } type Props = OwnProps & StateProps & DispatchProps; export class RFPDetail extends React.Component { componentDidMount() { this.props.fetchRfp(this.props.rfpId); } render() { const { rfp, isFetchingRfps } = this.props; // Optimistically render rfp if we have it, but are updating it if (!rfp) { if (isFetchingRfps) { return ; } else { return ; } } const isLive = rfp.status === RFP_STATUS.LIVE; const tags = []; if (rfp.matching) { tags.push( x2 matching , ); } if (rfp.bounty) { if (rfp.isVersionTwo) { tags.push( {formatUsd(rfp.bounty.toString(10))} bounty , ); } else { tags.push( bounty , ); } } if (!isLive) { tags.push( Closed , ); } return (
Back to Requests
Opened {moment(rfp.dateOpened * 1000).format('LL')}

{rfp.title}

{tags}

{rfp.brief}

    {rfp.bounty && rfp.isVersionTwo && (
  • Accepted proposals will be funded up to{' '} {formatUsd(rfp.bounty.toString(10))} in ZEC
  • )} {rfp.bounty && !rfp.isVersionTwo && (
  • Accepted proposals will be funded up to{' '}
  • )} {rfp.matching && (
  • Contributions will have their funding matched by the Zcash Foundation
  • )} {rfp.dateCloses && (
  • Proposal submissions end {moment(rfp.dateCloses * 1000).format('LL')}
  • )} {rfp.ccr && (
  • Submitted by{' '} {rfp.ccr.author.displayName}
  • )}
{!!rfp.acceptedProposals.length && (

Accepted Proposals

{rfp.acceptedProposals.map(p => ( ))}
)}
); } } export default connect( (state, ownProps) => ({ rfp: getRfp(state, ownProps.rfpId), isFetchingRfps: state.rfps.isFetchingRfps, fetchRfpsError: state.rfps.fetchRfpsError, }), { fetchRfp }, )(RFPDetail);