<commit_before>// @flow
import React, { Component } from 'react';
import {Row, Col} from 'react-flexbox-grid';
import {Link} from 'react-router';
import LogoImg from '../../logo.png';
import { connect } from 'react-redux'
import { logout } from '../../actions/auth'
import { hashHistory } from 'react-router';
import { Dialog, Intent, Button } from '@blueprintjs/core';

class Header extends Component {
  constructor(props){
    super(props);
    this.state = {
      DialogActive: false,
    }
  }

  logout(e){
    e.preventDefault();
    if(this.props.contador.isActive){
      this.setState({DialogActive: true})
    }
    else{
      this.confirmLogout();
    }
  }

  confirmLogout(e){
    this.props.logout();
    hashHistory.push('/')
  }

<<<<<<< HEAD
  validateLogout (e){
    axios.get('http://localhost:1337/contador?sort=updatedAt DESC')
  }
=======
  toggleDialog(e){
    this.setState({DialogActive: !this.state.DialogActive})
  }

>>>>>>> d5235fdb97c2cfee3d8f684045f5ac84d20c021f
  render() {
    return (
      <div>
        <Row center="xs" className="Header pt-navbar" style={{margin:0}}>
          <Col xs={12} sm={10}>
            <Row className="Header-Container" end="xs" middle="xs">
              <Col className="Header-Logo">
                <img src={LogoImg} />
              </Col>
              <Col xs={6}>
                <Link className="pt-button pt-minimal pt-icon-home"></Link>
                <Link className="pt-button pt-minimal pt-icon-user"></Link>
                <a className="pt-button pt-minimal pt-icon-delete" onClick={e => this.logout(e)}></a>
              </Col>
            </Row><commit_msg>corrigiendo header<commit_after>// @flow
import React, { Component } from 'react';
import {Row, Col} from 'react-flexbox-grid';
import {Link} from 'react-router';
import LogoImg from '../../logo.png';
import { connect } from 'react-redux'
import { logout } from '../../actions/auth'
import { hashHistory } from 'react-router';
import { Dialog, Intent, Button } from '@blueprintjs/core';

class Header extends Component {
  constructor(props){
    super(props);
    this.state = {
      DialogActive: false,
    }
  }

  logout(e){
    e.preventDefault();
    if(this.props.contador.isActive){
      this.setState({DialogActive: true})
    }
    else{
      this.confirmLogout();
    }
  }

  confirmLogout(e){
    this.props.logout();
    hashHistory.push('/')
  }


  toggleDialog(e){
    this.setState({DialogActive: !this.state.DialogActive})
  }

  render() {
    return (
      <div>
        <Row center="xs" className="Header pt-navbar" style={{margin:0}}>
          <Col xs={12} sm={10}>
            <Row className="Header-Container" end="xs" middle="xs">
              <Col className="Header-Logo">
                <img src={LogoImg} />
              </Col>
              <Col xs={6}>
                <Link className="pt-button pt-minimal pt-icon-home"></Link>
                <Link className="pt-button pt-minimal pt-icon-user"></Link>
                <a className="pt-button pt-minimal pt-icon-delete" onClick={e => this.logout(e)}></a>
              </Col>
            </Row>
{'fraction_non_alphanumeric': 0.1696485623003195, 'fraction_numerical': 0.012460063897763577, 'mean_word_length': 2.4827586206896552, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 44, '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': '2256619', 'n_tokens_mistral': 1020, 'n_tokens_neox': 986, 'n_words': 202}