<commit_before>'use strict';

import React from 'react';
import {Link} from 'react-router-dom';

const Hero = () => (
  <section className="text-center hero" id="hero-area">
    <div className="container">
      <div className="row">
        <div className="col-md-12">
          <div className="intro-area">
            <h2 className="page-title">
              <Link to="/">pragmatism</Link>
            </h2>
            <h3>
              <i>noun</i> &middot; an approach to problems and situations that is based on practical solutions.
            </h3>
          </div>
        </div>
      </div>
    </div>
  </section>
);

export default Hero;<commit_msg>Adds rotating sayings in Hero<commit_after>'use strict';

import React from 'react';
import {Link} from 'react-router-dom';
import { withRouter } from 'react-router'

let saying_index = -1;
const sayings = [
  {word: 'pragmatism', def: 'an approach to problems and situations that is based on practical solutions.'},
  {word: 'minimalism', def: 'a style or technique that is characterized by extreme spareness and simplicity.'}
];

class Hero extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      saying: {}
    };
  }
  
  componentDidMount() {
    this.setSaying();
    this.props.history.listen(this.setSaying);
  }
  
  setSaying = () => {
    saying_index += 1;
    if (saying_index > sayings.length - 1) {
      saying_index = 0;
    }
    const saying = sayings[saying_index];
    this.setState({saying});
  };
  
  render() {
    const {saying} = this.state;
    
    return (
      <section className="text-center hero" id="hero-area">
        <div className="container">
          <div className="row">
            <div className="col-md-12">
              <div className="intro-area">
                <h2 className="page-title">
                  <Link to="/">
                    {saying.word}
                  </Link>
                </h2>
                <h3>
                  {saying.def}
                </h3>
              </div>
            </div>
          </div>
        </div>
      </section>
    );
  }
}

export default withRouter(Hero);
{'fraction_non_alphanumeric': 0.14226327944572748, 'fraction_numerical': 0.007390300230946882, 'mean_word_length': 1.9509536784741144, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 40, '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': '2244927', 'n_tokens_mistral': 671, 'n_tokens_neox': 653, 'n_words': 164}