context = window rest = context.JK.Rest() @GiftCardLandingPage = React.createClass({ render: () -> if this.state.done ctaButtonText10 = 'sending you in...' ctaButtonText20 = 'sending you in...' else if this.state.processing ctaButtonText10 = 'hold on...' ctaButtonText20 = 'hold on...' else ctaButtonText10 = `ADD $10 CARD
TO CART
` ctaButtonText20 = `ADD $20 CARD
TO CART
` ctaButtons = `
` `
gift card

$10 or $20 JAMTRACKS GIFT CARDS

A PERFECT GIFT FOR MUSICIANS

Preview A JamTrack
"{this.props.jam_track.name}"

Click the play buttons below to preview the master mix and 20-second samples of all the isolated tracks.

Get a $10 gift card (good for 5 songs) or a $20 gift card (good for 10 songs), and your happy gift card getter can choose their favorites from our catalog of 3,700+ popular songs.

{ctaButtons} or browse our catalog of 3,700+ songs

JamTracks by JamKazam are the best way to play along with your favorite songs. Far better and different than traditional backing tracks, our JamTracks are complete multi-track professional recordings, with fully isolated tracks for each part of the music. And our free app and Internet service are packed with features that give you unmatched creative freedom to learn, practice, record, play with others, and share your performances.

` getInitialState: () -> {processing:false} componentDidMount:() -> $root = $(this.getDOMNode()) # add item to cart, create the user if necessary, and then place the order to get the free JamTrack. ctaClick: (card_type, e) -> e.preventDefault() return if @state.processing loggedIn = context.JK.currentUserId? rest.addGiftCardToShoppingCart({id: card_type}).done((response) => if loggedIn @setState({done: true}) context.location = '/client#/shoppingCart' else @setState({done: true}) context.location = '/client#/shoppingCart' ).fail((jqXHR, textStatus, errorMessage) => if jqXHR.status == 422 errors = JSON.parse(jqXHR.responseText) cart_errors = errors?.errors?.cart_id context.JK.app.ajaxError(jqXHR, textStatus, errorMessage) @setState({processing:false}) ) })