<commit_before>/**
 * Component that lists all Posts
 */
import React from 'react'
import { graphql } from 'react-apollo'
import gql from 'graphql-tag'
// import { Link } from 'react-router'
import { withRouter } from 'react-router'

class EventPage extends React.Component {

  static propTypes = {
    data: React.PropTypes.shape({
      loading: React.PropTypes.bool,
      error: React.PropTypes.object,
      Event: React.PropTypes.object,
    }).isRequired,
    router: React.PropTypes.object.isRequired,
    params: React.PropTypes.object.isRequired
  }

  
  render () {
    // const outputUrl = "http://placehold.it/400x400";
    // var myText = this.props.params.id;
    // console.log(this.props.data.Event)
    // let outputUrl = '';
    
    // if(this.props.data.Event.publicId === null) {
    //   outputUrl = this.props.data.Event.imageUrl;
    // } else {
    //   outputUrl = 'http://res.cloudinary.com/dqpknoetx/image/upload/c_scale,w_1200/v1489441520/' + this.props.data.Event.publicId;
    // }

    if (this.props.data.loading) {
      return (<div>Loading</div>)
    }

     if (this.props.data.error) {
      console.log(this.props.data.error)
      return (<div>An unexpected error occurred</div>)
    }

    // const Event = this.props.data.Event

    return (
        <article>
            <div className="pa4 ph7-l georgia mw9-l center">
                { this.props.data.Event.publicId ? 
                  <img src={`http://res.cloudinary.com/dqpknoetx/image/upload/c_scale,w_1200/v1489441520/${this.props.data.Event.publicId}`} alt={this.props.data.Event.name} />  :
                  <img src={this.props.data.Event.imageUrl} alt={this.props.data.Event.name} /> 
                }
                <h3 className="f3">{this.props.data.Event.name} </h3>
                <p className="mid-gray f3 lh-copy">
                    {this.props.data.Event.description}
                    {this.props.data.Event.publicId}
                </p>
            </div>
        </article>
    )
  }
}


const EventQuery = gql`
query EventQuery($id: ID!) {
    Event(id: $id) {
      id
      imageUrl
      publicId
      name
      description
    }
  }
`

const EventPageWithQuery = graphql(EventQuery,{<commit_msg>removed ID<commit_after>/**
 * Component that lists all Posts
 */
import React from 'react'
import { graphql } from 'react-apollo'
import gql from 'graphql-tag'
// import { Link } from 'react-router'
import { withRouter } from 'react-router'

class EventPage extends React.Component {

  static propTypes = {
    data: React.PropTypes.shape({
      loading: React.PropTypes.bool,
      error: React.PropTypes.object,
      Event: React.PropTypes.object,
    }).isRequired,
    router: React.PropTypes.object.isRequired,
    params: React.PropTypes.object.isRequired
  }

  
  render () {
    // const outputUrl = "http://placehold.it/400x400";
    // var myText = this.props.params.id;
    // console.log(this.props.data.Event)
    // let outputUrl = '';
    
    // if(this.props.data.Event.publicId === null) {
    //   outputUrl = this.props.data.Event.imageUrl;
    // } else {
    //   outputUrl = 'http://res.cloudinary.com/dqpknoetx/image/upload/c_scale,w_1200/v1489441520/' + this.props.data.Event.publicId;
    // }

    if (this.props.data.loading) {
      return (<div>Loading</div>)
    }

     if (this.props.data.error) {
      console.log(this.props.data.error)
      return (<div>An unexpected error occurred</div>)
    }

    // const Event = this.props.data.Event

    return (
        <article>
            <div className="pa4 ph7-l georgia mw9-l center">
                { this.props.data.Event.publicId ? 
                  <img src={`http://res.cloudinary.com/dqpknoetx/image/upload/c_scale,w_1200/v1489441520/${this.props.data.Event.publicId}`} alt={this.props.data.Event.name} />  :
                  <img src={this.props.data.Event.imageUrl} alt={this.props.data.Event.name} /> 
                }
                <h3 className="f3">{this.props.data.Event.name} </h3>
                <p className="mid-gray f3 lh-copy">
                    {this.props.data.Event.description}
                </p>
            </div>
        </article>
    )
  }
}


const EventQuery = gql`
query EventQuery($id: ID!) {
    Event(id: $id) {
      id
      imageUrl
      publicId
      name
      description
    }
  }
`

const EventPageWithQuery = graphql(EventQuery,{
{'fraction_non_alphanumeric': 0.14616432137993646, 'fraction_numerical': 0.01861098502042669, 'mean_word_length': 2.150107219442459, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '4909903', 'n_tokens_mistral': 1523, 'n_tokens_neox': 1440, 'n_words': 241}