<commit_before>var Cart = React.createClass({
  checkoutClickHandler: function(){
    if (this.props.signedIn) {
      window.location.replace("http://localhost:3000/checkout");
    } else {
      $(".modal-overlay").slideDown();
      $(".exit-modal").on("click", function(){
        $(".modal-overlay").slideUp();
      });

      $("#sign-up").on("click", function(e){
        e.preventDefault();
        $(".sign-in-container").hide();
        $(".sign-up-container").show();
      })

      $("#sign-in").on("click", function(e){
        e.preventDefault();
        $(".sign-in-container").show();
        $(".sign-up-container").hide();

      })

    }
  },
  render: function(){
    var cartArray = [];
    var cart = this.props.cart;
    var totalCheckoutPrice = 0;
    for (var key in cart) {
      if (cart[key]["quantity"] > 0)
        cartArray.push(<CartItem price={cart[key]["itemInfo"]["price"]} name={cart[key]["itemInfo"]["name"]} quantity={cart[key]["quantity"]} />)
        totalCheckoutPrice += cart[key]["itemInfo"]["price"] * cart[key]["quantity"]
    }

    console.log(cartArray);
    console.log(this.props.cart);

    return (
	      <div className="cart" >
                  <div className="inventory">
                    <h2>Box Summary</h2>
                    <table className="summary">
                      <tr>
                        <th>Item</th>
                        <th>Price</th>
                        <th>Quantity</th>
                      </tr>
                      {cartArray}
                    </table>
                  </div>
	      	<div className='checkout-container'>
                  <h3>Total: ${totalCheckoutPrice.toFixed(2)}</h3>
	      	<button type="button" onClick={this.checkoutClickHandler} className="btn btn-warning" id="checkout-btn">Checkout</button>
      	        </div>
	      </div>
    );
  }
});

<commit_msg>started on ajax request but need to know more about devise to move forward<commit_after>var Cart = React.createClass({
  checkoutClickHandler: function(){
    if (this.props.signedIn) {
      window.location.replace("http://localhost:3000/checkout");
    } else {
      $(".modal-overlay").slideDown();
      $(".exit-modal").on("click", function(){
        $(".modal-overlay").slideUp();
      });

      $("#sign-up").on("click", function(e){
        e.preventDefault();
        $(".sign-in-container").hide();
        $(".sign-up-container").show();
      })

      $("#sign-in").on("click", function(e){
        e.preventDefault();
        $(".sign-in-container").show();
        $(".sign-up-container").hide();
      })

      $(".sign-in-form").on("submit", function(){
        var data = $(this).serialize();
        $.ajax({
          url: "/users/sign_in",
          type: "POST",
          data: data
        })
        .done(function(response){
          console.log("success")
        })
        .fail(function(response){
          console.log("failed")
        })
      });
    }
  },
  render: function(){
    var cartArray = [];
    var cart = this.props.cart;
    var totalCheckoutPrice = 0;
    for (var key in cart) {
      if (cart[key]["quantity"] > 0)
        cartArray.push(<CartItem price={cart[key]["itemInfo"]["price"]} name={cart[key]["itemInfo"]["name"]} quantity={cart[key]["quantity"]} />)
        totalCheckoutPrice += cart[key]["itemInfo"]["price"] * cart[key]["quantity"]
    }

    console.log(cartArray);
    console.log(this.props.cart);

    return (
	      <div className="cart" >
                  <div className="inventory">
                    <h2>Box Summary</h2>
                    <table className="summary">
                      <tr>
                        <th>Item</th>
                        <th>Price</th>
                        <th>Quantity</th>
                      </tr>
                      {cartArray}
                    </table>
                  </div>
	      	<div className='checkout-container'>
                  <h3>Total: ${totalCheckoutPrice.toFixed(2)}</h3>
	      	<button type="button" onClick={this.checkoutClickHandler} className="btn btn-warning" id="checkout-btn">Checkout</button>
      	        </div>
	      </div>
    );
  }
});


{'fraction_non_alphanumeric': 0.18727662616154395, 'fraction_numerical': 0.005241839409101739, 'mean_word_length': 1.8596730245231607, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4323335', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1218, 'n_words': 187}