<commit_before>import React, { Component } from 'react';
import {
  Navbar,
  Container,
  NavbarToggler,
  NavbarBrand,
  Collapse,
  Nav,
  NavItem,
  NavLink
} from 'reactstrap';
import styles from './Base.styl';
import classNames from 'classnames';
import { store } from './../../flux';
import { Link } from 'react-router-dom';

export default class Base extends Component {
  constructor(props) {
    super(props);

    this.toggle = this.toggle.bind(this);
    this.state = {
      isOpen: false,
      amount: 0
    };
  }

  componentDidMount() {
    store.checkout.on('checkoutGamesModified', () => {
      const gamesList = store.checkout.getGamesList();
      const amount = gamesList.length;
      
      this.setState({
        amount
      });
    });
  }

  toggle() {
    this.setState({
      isOpen: !this.state.isOpen
    });
  }

  render() {
    const { amount } = this.state;

    return (
      <div>
        <Navbar toggleable className={styles.navbar_dark}>
          <NavbarToggler
            right
            onClick={this.toggle}
            className={styles.navbar_toggler_light}
          />
          <Container className={styles.container_min_width}>
            <Link
              className={classNames('navbar-brand', styles.navbar_link_white)}
              to="/"
            >
              Jogar.me
            </Link>
            <Collapse isOpen={this.state.isOpen} navbar>
              <Nav className="ml-auto" navbar>
                <NavItem>
                  <Link
                    className={classNames(
                      'nav-link',
                      styles.navbar_link_white,
                      styles.navbar_basket
                    )}<commit_msg>Removendo state de amount. Deixando amount sendo obtido diretamente pela store, no método render.<commit_after>import React, { Component } from 'react';
import {
  Navbar,
  Container,
  NavbarToggler,
  NavbarBrand,
  Collapse,
  Nav,
  NavItem,
  NavLink
} from 'reactstrap';
import styles from './Base.styl';
import classNames from 'classnames';
import { store } from './../../flux';
import { Link } from 'react-router-dom';

export default class Base extends Component {
  constructor(props) {
    super(props);

    this.state = { isOpen: false };
  }

  componentDidMount() {
    store.checkout.on('checkoutGamesModified', () => {
      this.forceUpdate();
    });
  }

  toggle() {
    this.setState({
      isOpen: !this.state.isOpen
    });
  }

  render() {
    const gamesList = store.checkout.getGamesList();
    const amount = gamesList.length;

    return (
      <div>
        <Navbar toggleable className={styles.navbar_dark}>
          <NavbarToggler
            right
            onClick={this.toggle.bind(this)}
            className={styles.navbar_toggler_light}
          />
          <Container className={styles.container_min_width}>
            <Link
              className={classNames('navbar-brand', styles.navbar_link_white)}
              to="/"
            >
              Jogar.me
            </Link>
            <Collapse isOpen={this.state.isOpen} navbar>
              <Nav className="ml-auto" navbar>
                <NavItem>
                  <Link
                    className={classNames(
                      'nav-link',
                      styles.navbar_link_white,
                      styles.navbar_basket
                    )}
{'fraction_non_alphanumeric': 0.11612142646625405, 'fraction_numerical': 0.0002947244326554671, 'mean_word_length': 1.811930405965203, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '7637829', 'n_tokens_mistral': 992, 'n_tokens_neox': 953, 'n_words': 193}