import React, { PropTypes } from 'react';
import { Button, Input, Col, Panel, Row, Well } from 'react-bootstrap';
import { contain } from 'thundercats-react';
// real paypal buttons
// will take your money
const paypalIds = {
regular: 'Q8Z82ZLAX3Q8N',
highlighted: 'VC8QPSKCYMZLN'
};
export default contain(
{
store: 'JobsStore',
actions: [
'jobActions',
'appActions'
],
map({
job: { id, isHighlighted } = {},
buttonId = isHighlighted ?
paypalIds.highlighted :
paypalIds.regular,
price = 200,
discountAmount = 0,
promoCode = '',
promoApplied = false,
promoName
}) {
return {
id,
isHighlighted,
buttonId,
price,
discountAmount,
promoName,
promoCode,
promoApplied
};
}
},
React.createClass({
displayName: 'GoToPayPal',
propTypes: {
appActions: PropTypes.object,
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
},
goToJobBoard() {
const { appActions } = this.props;
appActions.updateRoute('/jobs');
},
renderDiscount(discountAmount) {
if (!discountAmount) {
return null;
}
return (
Promo Discount
-{ discountAmount }
Highlighting
+ 50