From c2bebcb77ac3c2631727fe7908313340160e0044 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Sun, 25 Oct 2015 18:22:26 -0700 Subject: [PATCH] render highlight cost --- .../app/routes/Jobs/components/GoToPayPal.jsx | 59 +++++++++++++++---- 1 file changed, 46 insertions(+), 13 deletions(-) diff --git a/common/app/routes/Jobs/components/GoToPayPal.jsx b/common/app/routes/Jobs/components/GoToPayPal.jsx index 8455f3fc47..6e3a7d6b55 100644 --- a/common/app/routes/Jobs/components/GoToPayPal.jsx +++ b/common/app/routes/Jobs/components/GoToPayPal.jsx @@ -28,7 +28,47 @@ export default contain( propTypes: { id: PropTypes.string, isHighlighted: PropTypes.bool, - buttonId: PropTypes.string + buttonId: PropTypes.string, + price: PropTypes.number, + discountAmount: PropTypes.number + }, + + renderDiscount(discountAmount) { + if (!discountAmount) { + return null; + } + return ( + + +

Discount

+ + +

-{ discountAmount }

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

Highlighting

+ + +

+ 50

+ +
+ ); }, render() { @@ -68,17 +108,8 @@ export default contain(

+{ price }

- - -

Discount

- - -

-{ discountAmount }

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

${ price - discountAmount }

+

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