<commit_before>import React from 'react'
import {connect} from 'react-redux'

import {GridTile} from 'material-ui/GridList';
import IconButton from 'material-ui/IconButton';
import CheckBox from 'material-ui/svg-icons/toggle/check-box';

import {getArtist, getTopTracks} from '../api'
import {fetchEvents} from '../actions/events'

class ArtistTile extends React.Component {
  constructor(props) {
    let {artists} = props
    super(props)
    this.state = {
      artist:undefined,
      tracksArray: [],
      artistID: '',
      trackIDs: [],
    tracks: []
    }
  }
  componentDidMount() {
    getArtist(this.props.event.artists[0])
      .then((artist) => {
        this.setState({artist})
      })
      .then(() => {
        let tracksArray = []
        if(this.state.artist!=undefined){
          getTopTracks(this.state.artist.id)
              .then((tracks) => {
                tracks.map((track) => {
                  tracksArray.push(track.id)
                })
              })
              .then(() => {
                this.setState({tracksArray})
              })
        }
      })
  }

  render(){
    let event = this.props.event || []
    let color = this.props.checkArtist(event.artists[0])
    return (
      <GridTile
        key={this.props.i}
        title={event.gig}
        subtitle={<span>Headline Act: <b>{event.artists[0]}</b></span>}
        actionIcon={
          <IconButton>
            <CheckBox color={color} onClick={(e)=>this.props.handleClick(e,event.artists[0],this.state.tracksArray)}/>
          </IconButton>}
      >
        {this.state.artist===undefined ? <img src='/images/unknownartist.png' /> : <img src={this.state.artist.images[0].url} />
        }
      </GridTile>
    )
  }
}<commit_msg>merging<commit_after>import React from 'react'
import {connect} from 'react-redux'

import {GridTile} from 'material-ui/GridList';
import IconButton from 'material-ui/IconButton';
import CheckBox from 'material-ui/svg-icons/toggle/check-box';

import {getArtist, getTopTracks} from '../api'
import {fetchEvents} from '../actions/events'

class ArtistTile extends React.Component {
  constructor(props) {
    let {artists} = props
    super(props)
    this.state = {
      artist:undefined,
      tracksArray: [],
      artistID: '',
      trackIDs: [],
    tracks: []
    }
  }
  componentDidMount() {
    getArtist(this.props.event.artists[0])
      .then((artist) => {
        this.setState({artist})
      })
      .then(() => {
        let tracksArray = []
        if(this.state.artist!=undefined){
          getTopTracks(this.state.artist.id)
              .then((tracks) => {
                tracks.map((track) => {
                  tracksArray.push(track.id)
                })
              })
              .then(() => {
                this.setState({tracksArray})
              })
        }
      })
  }

  render(){
    console.log(this.state.tracksArray)
    let event = this.props.event || []
    let color = this.props.checkArtist(event.artists[0])
    return (
      <GridTile
        key={this.props.i}
        title={event.artists[0]}
        subtitle={<span><b>{event.date}</b></span>}
        actionIcon={
          <IconButton>
            <CheckBox color={color} onClick={(e)=>this.props.handleClick(e,event.artists[0],this.state.tracksArray)}/>
          </IconButton>}
      >
        {this.state.artist===undefined ? <img src='/images/unknownartist.png' /> : <img src={this.state.artist.images[0].url} />
        }
      </GridTile>
    )
  }
}
{'fraction_non_alphanumeric': 0.161409491332765, 'fraction_numerical': 0.002841716396703609, 'mean_word_length': 2.1178033658104516, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 37, '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': '7297884', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1104, 'n_words': 167}