import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router';


class Event extends Component {
  render() {
    if(!this.props.activeEvent) {
      return <div>Select an event to get started.</div>;
    }else{
      return (
        <div>
          <h3>Details for:</h3>
          <div>Title: {this.props.activeEvent.title}</div>
          <div>Description: {this.props.activeEvent.description}</div>
          <Link to={`/events/${this.props.activeEvent.id}/chatroom`} params={{id:this.props.activeEvent.id}}>
            Chat With Locals
          </Link>
        </div>
      );
    }
  }
}


function mapStateToProps(state) {
  return { activeEvent: state.activeEvent };
}

export default connect(mapStateToProps)(Event);

@@ -154,24 +154,37 @@
  render() %7B%0A
+    debugger%0A
     if(!this
@@ -201,16 +201,22 @@
 iveEvent
+.title
 ) %7B%0A    

fix bug where no events are selected