Skip to content

Instantly share code, notes, and snippets.

@dandean
Forked from mjackson/ternary.js
Created March 4, 2016 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dandean/5bfe7c7e2b4c98de1c9d to your computer and use it in GitHub Desktop.
Save dandean/5bfe7c7e2b4c98de1c9d to your computer and use it in GitHub Desktop.
<div className="pricing" style={{ opacity: purchasing ? 0.25 : '' }}>
<Conditional if={purchaseComplete}>
<div className="purchase-complete">
<h2>Thanks!</h2>
<p>
Thank you for your purchase of {formatPrice(this.state.total)}.
We’ll send you a receipt shortly.
</p>
<p>
<button
className="cta-button outlined-button"
onClick={() => this.replaceState(this.getInitialState())}
>
Buy more tickets
</button>
</p>
</div>
</Conditional>
<Conditional if={!purchaseComplete && promoAvailable}>
<PurchaseBlock
price={promo}
regularPrice={regular}
title={`Promo: ${query.c}`}
getAvailableSeats={() => getAvailableSeatsWithPromo(training, promo)}
onPurchase={this.purchaseWithPromo}
/>
</Conditional>
<Conditional if={!purchaseComplete && earlyBirdAvailable}>
<PurchaseBlock
price={earlyBird}
regularPrice={regular}
title="Early Bird Price"
getAvailableSeats={() => getAvailableSeats(training)}
onPurchase={this.purchaseEarlyBird}
/>
</Conditional>
<Conditional if={!purchaseComplete && (!earlyBirdAvailable && !promoAvailable)}>
<PurchaseBlock
price={regular}
title="Ticket Price"
getAvailableSeats={() => getAvailableSeats(training)}
onPurchase={this.purchaseRegular}
/>
</Conditional>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment