<commit_before>/** @jsx React.DOM */

(function() {
  var NewsFeedItem = require('./news_feed_item.js.jsx');
  var FILTERS = ['bounties', 'introductions', 'posts'];

  var NewsFeed = React.createClass({
    fetchMoreNewsFeedItems: function(e) {
      this.setState({
        page: this.state.page + 1
      }, function() {
        var url = window.location.pathname + '?page=' + this.state.page +
          '&filter=' + this.state.filter;

        window.xhr.get(
          url,
          this._handleMoreNewsFeedItems
        );
      }.bind(this));
    },

    filterBy: function(filter, e) {
      this.setState({
        filter: filter
      }, function() {
        var url = window.location.pathname + '?page=' + this.state.page +
          '&filter=' + filter;

        window.xhr.get(url, this._handleFilteredNewsFeedItems);
      }.bind(this));
    },

    filters: function() {
      return (
        <div className="center">
          <ul className="nav nav-mini-pills">
            {_.map(FILTERS, function(filter) {
              var buttonClass = filter === this.state.filter ?
                'active' :
                '';
              return (
                <li className={buttonClass}>
                  <a href="javascript:void(0);"
                      onClick={this.filterBy.bind(this, filter)}>
                    {filter}
                  </a>
                </li>
              );
            }.bind(this))}
          </ul>
        </div>
      );
    },

    getInitialState: function() {
      return {
        filter: (window.parseUri(window.location).queryKey.filter || ''),
        news_feed_items: this.props.news_feed_items,
        page: (window.parseUri(window.location).queryKey.page || 1)
      };
    },

    render: function() {
      window.analytics.track(
        'news_feed_item.viewed', {
          product: (window.app.currentAnalyticsProduct())
        }
      );
      
      return (
        <div>
          {this.filters()}
          {this.renderNewsFeedItems()}
          <div className="mb4">
            <a href="javascript:void(0);"
                onClick={this.fetchMoreNewsFeedItems}
                className="btn btn-default btn-block">
              Load more
            </a>
          </div>
        </div>
      );
    },
<commit_msg>Capitalize and add margins to updates nav<commit_after>/** @jsx React.DOM */

(function() {
  var NewsFeedItem = require('./news_feed_item.js.jsx');
  var FILTERS = {
    bounties: 'Bounties',
    introductions: 'Introductions',
    posts: 'Posts'
  }

  var NewsFeed = React.createClass({
    fetchMoreNewsFeedItems: function(e) {
      this.setState({
        page: this.state.page + 1
      }, function() {
        var url = window.location.pathname + '?page=' + this.state.page +
          '&filter=' + this.state.filter;

        window.xhr.get(
          url,
          this._handleMoreNewsFeedItems
        );
      }.bind(this));
    },

    filterBy: function(filter, e) {
      this.setState({
        filter: filter
      }, function() {
        var url = window.location.pathname + '?page=' + this.state.page +
          '&filter=' + filter;

        window.xhr.get(url, this._handleFilteredNewsFeedItems);
      }.bind(this));
    },

    filters: function() {
      return (
        <div className="center mt2">
          <ul className="nav nav-mini-pills">
            {_.map(_.keys(FILTERS), function(filter) {
              var label = FILTERS[filter];
              var buttonClass = filter === this.state.filter ?
                'active' :
                '';
              return (
                <li className={buttonClass}>
                  <a href="javascript:void(0);"
                      onClick={this.filterBy.bind(this, filter)}>
                    {label}
                  </a>
                </li>
              );
            }.bind(this))}
          </ul>
        </div>
      );
    },

    getInitialState: function() {
      return {
        filter: (window.parseUri(window.location).queryKey.filter || ''),
        news_feed_items: this.props.news_feed_items,
        page: (window.parseUri(window.location).queryKey.page || 1)
      };
    },

    render: function() {
      window.analytics.track(
        'news_feed_item.viewed', {
          product: (window.app.currentAnalyticsProduct())
        }
      );
      
      return (
        <div>
          {this.filters()}
          <div className="mt4">
            {this.renderNewsFeedItems()}
          </div>
          <div className="mb4">
            <a href="javascript:void(0);"
                onClick={this.fetchMoreNewsFeedItems}
                className="btn btn-default btn-block">
              Load more
            </a>
          </div>
        </div>
      );
    },

{'fraction_non_alphanumeric': 0.14288702928870292, 'fraction_numerical': 0.002510460251046025, 'mean_word_length': 1.5871212121212122, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '4439565', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1376, 'n_words': 238}