<commit_before>var React = require('react');

// Component that displays related results from Walmart API
var WalmartRelatedResultsDisplay = React.createClass({
  handleWalmartReviewRequest: function(itemId) {
    this.props.onWalmartReviewRequest(itemId);
  },
  render: function() {
    var resultNodes = this.props.data.walmart.map(function(result, index) {

      result.shortDescription = result.shortDescription || '';

      return (
        <WalmartIndividualResultDisplay 
          name={result.name} 
          salePrice={result.salePrice}
          upc={result.upc} 
          shortDescription={result.shortDescription}
          thumbnailImage={result.thumbnailImage}
          customerRating={result.customerRating}
          numReviews={result.numReviews}
          customerRatingImage={result.customerRatingImage}
          itemId={result.itemId} 
          onWalmartReviewRequest={this.handleWalmartReviewRequest} />
      );
    }.bind(this));
    return (
      <div className="related-results-display hidden">
        <h3>Walmart Related Results</h3>
        {resultNodes}
      </div>
    );
  }
});

// Component that displays individual results for Walmart
var WalmartIndividualResultDisplay = React.createClass({
  handleWalmartReviewRequest: function() {

    $('.walmart-reviews-display').removeClass('hidden');

    this.props.onWalmartReviewRequest({itemId: this.props.itemId});
  },  
  render: function() {
    return (
      <div className="individual-display" onClick={this.handleWalmartReviewRequest}>
        <h5 className="product-name">
          {this.props.name}
        </h5>
        <img src={this.props.thumbnailImage} />
        <div>
          ${this.props.salePrice}
        </div>
        <div>
          UPC: ${this.props.upc}
        </div>
        <div>
          Description: {this.props.description}
        </div>
        <div>
          Rating: {this.props.customerRating}
        </div>
        <div>
          {this.props.numReviews} reviews
        </div>
        <img src={this.props.customerRatingImage} />
      </div>
    );
  }
});

var WalmartReviewsDisplay = React.createClass ({
  // name, overallRating, reviewer, reviewText, title, upVotes, downVotes
  render: function() {
    return (
      <div className="walmart-reviews-display hidden">
        Walmart Reviews
      </div>
    );
  }
});

var WalmartIndividualReviewDisplay = React.createClass({
  render: function() {
    return (
      <div>

      </div>
    );
  }
});

module.exports.WalmartRelatedResultsDisplay = WalmartRelatedResultsDisplay;

module.exports.WalmartIndividualResultDisplay = WalmartIndividualResultDisplay;

module.exports.WalmartReviewsDisplay = WalmartReviewsDisplay;<commit_msg>commit to get latest changes<commit_after>var React = require('react');

// Component that displays related results from Walmart API
var WalmartRelatedResultsDisplay = React.createClass({
  handleWalmartReviewRequest: function(itemId) {
    this.props.onWalmartReviewRequest(itemId);
  },
  render: function() {
    var resultNodes = this.props.data.walmart.map(function(result, index) {

      result.shortDescription = result.shortDescription || '';

      return (
        <WalmartIndividualResultDisplay 
          name={result.name} 
          salePrice={result.salePrice}
          upc={result.upc} 
          shortDescription={result.shortDescription}
          thumbnailImage={result.thumbnailImage}
          customerRating={result.customerRating}
          numReviews={result.numReviews}
          customerRatingImage={result.customerRatingImage}
          itemId={result.itemId} 
          onWalmartReviewRequest={this.handleWalmartReviewRequest} />
      );
    }.bind(this));
    return (
      <div className="related-results-display hidden">
        <h3>Walmart Related Results</h3>
        {resultNodes}
      </div>
    );
  }
});

// Component that displays individual results for Walmart
var WalmartIndividualResultDisplay = React.createClass({
  handleWalmartReviewRequest: function() {

    $('.walmart-reviews-display').removeClass('hidden');

    this.props.onWalmartReviewRequest({itemId: this.props.itemId});
  },  
  render: function() {
    return (
      <div className="individual-display" onClick={this.handleWalmartReviewRequest}>
        <h5 className="product-name">
          {this.props.name}
        </h5>
        <img src={this.props.thumbnailImage} />
        <div>
          ${this.props.salePrice}
        </div>
        <div>
          UPC: ${this.props.upc}
        </div>
        <div>
          Description: {this.props.description}
        </div>
        <div>
          Rating: {this.props.customerRating}
        </div>
        <div>
          {this.props.numReviews} reviews
        </div>
        <img src={this.props.customerRatingImage} />
      </div>
    );
  }
});

var WalmartReviewsDisplay = React.createClass ({
  // name, overallRating, reviewer, reviewText, title, upVotes, downVotes
  render: function() {
    var resultNotes = this.props.data.walmartReviews.map(function(result, index) {
      return (
        <WalmartIndividualResultDisplay
          title={result.title}
          name={result.name}
          overallRating={result.overallRating}
          reviewer={result.reviewer}
          reviewTest={result.reviewTest}
          upVotes={result.upVotes}
          downVotes={result.downVotes} />
      );
    });

    return (
      <div className="walmart-reviews-display hidden">
        Walmart Reviews
      </div>
    );
  }
});

var WalmartIndividualReviewDisplay = React.createClass({
  render: function() {
    return (
      <div>

      </div>
    );
  }
});

module.exports.WalmartRelatedResultsDisplay = WalmartRelatedResultsDisplay;

module.exports.WalmartIndividualResultDisplay = WalmartIndividualResultDisplay;

module.exports.WalmartReviewsDisplay = WalmartReviewsDisplay;
{'fraction_non_alphanumeric': 0.11945624468988955, 'fraction_numerical': 0.0013593882752761257, 'mean_word_length': 2.737142857142857, 'pattern_counts': {'":': 0, '<': 54, '<?xml version=': 0, '>': 54, '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': '1997585', 'n_tokens_mistral': 1744, 'n_tokens_neox': 1626, 'n_words': 274}