import React, { PropTypes } from 'react'; import { Button, Input, Col, Panel, Row, Well } from 'react-bootstrap'; import { contain } from 'thundercats-react'; const paypalIds = { regular: 'ZVU498PLMPHKU', regularDiscount: '58U7P36W3L2GQ', highlighted: '3YYSTBAMJYTUW', highlightedDiscount: 'QGWTUZ9XEE6EL' }; export default contain( { store: 'JobsStore', actions: 'jobActions', map({ job: { id, isHighlighted } = {}, buttonId = paypalIds.regular, price = 200, discountAmount = 0, promoCode = '', promoApplied = false, promoName }) { return { id, isHighlighted, buttonId, price, discountAmount, promoName, promoCode, promoApplied }; } }, React.createClass({ displayName: 'GoToPayPal', propTypes: { id: PropTypes.string, isHighlighted: PropTypes.bool, buttonId: PropTypes.string, price: PropTypes.number, discountAmount: PropTypes.number, promoName: PropTypes.string, promoCode: PropTypes.string, promoApplied: PropTypes.bool, jobActions: PropTypes.object }, renderDiscount(discountAmount) { if (!discountAmount) { return null; } return (

Promo Discount

-{ discountAmount }

); }, renderHighlightPrice(isHighlighted) { if (!isHighlighted) { return null; } return (

Highlighting

+ 50

); }, renderPromo() { const { promoApplied, promoCode, promoName, isHighlighted, jobActions } = this.props; if (promoApplied) { return (
{ promoName } applied
); } return (
Have a promo code?
); }, render() { const { id, isHighlighted, buttonId, price, discountAmount } = this.props; return (

One more step

You're Awesome! just one more step to go. Clicking on the link below will redirect to paypal.

Job Posting

+ { price }

{ this.renderHighlightPrice(isHighlighted) } { this.renderDiscount(discountAmount) }

Total

${ price - discountAmount + (isHighlighted ? 50 : 0) }

{ this.renderPromo() }
An array of credit cards
); } }) );