<commit_before>import React from 'react';
import { Link } from 'react-router';
import NoteList from './sub/NoteList.jsx';
import LectureTitle from './sub/LectureTitle.jsx';
import {connect} from 'react-redux';
import {setRoomInfo} from '../actions/roomActions';
import {showHideThoughts} from '../actions/noteActions';
import Audio from './sub/Audio.jsx';
import UserReducer from '../reducers/userReducers';
import RoomReducer from '../reducers/roomReducers';
import NoteReducer from '../reducers/noteReducers';

class Review extends React.Component {
  constructor (props) {
    super(props);
    this.state = {
      loaded: false,
      thoughtButton: 'Show thoughts'
    };
  }
  componentWillMount() {
    var realm = this;
    var user = this.props.user.information[0];
    var pathUrl = this.props.params.roomId;
    this.props.dispatch(setRoomInfo(pathUrl, user, (err, success) => {
      if (err) {
        realm.context.router.push('/notebook');
      } else {
        realm.setState({loaded: true});
      }
    }));
    this.props.dispatch(showHideThoughts(true));
  }

  static get contextTypes() {
    return {
      router: React.PropTypes.object.isRequired,
    };
  }

  goToCompiledView() {
    this.context.router.push(`/compile/${this.props.room.roomInfo.pathUrl}`);
  }

  toggleThoughts() {
    if (this.state.thoughtButton === 'Show thoughts') {
      this.setState({
        thoughtButton: 'Hide thoughts'
      })
    } else {
      this.setState({
        thoughtButton: 'Show thoughts'
      })
    }
    this.props.dispatch(showHideThoughts());
  }

  render() {
    return (
      this.state.loaded ? (
      <div className="container">
        <div className="col-sm-10 panel panel-default">
          <LectureTitle />
          <NoteList />
        </div>
        <div className="col-sm-2">
          <button className="btn btn-md btn-primary" onClick={this.goToCompiledView.bind(this)}>
            Add / Edit Notes
          </button>
          <button className="btn btn-md btn-info" onClick={this.toggleThoughts.bind(this)}>
            {this.state.thoughtButton}
          </button>
        </div>
      </div>
    ) : (<div></div>)
    );
  }
}

const mapStateToProps = (state) => {
  return {
    ...state,
    UserReducer,
    RoomReducer,
    NoteReducer
  };
};

export default connect(mapStateToProps)(Review);<commit_msg>Update thoughtlist to include a map of thoughts<commit_after>import React from 'react';
import { Link } from 'react-router';
import NoteList from './sub/NoteList.jsx';
import ThoughtList from './sub/ThoughtList.jsx';
import LectureTitle from './sub/LectureTitle.jsx';
import {connect} from 'react-redux';
import {setRoomInfo} from '../actions/roomActions';
import {showHideThoughts} from '../actions/noteActions';
import Audio from './sub/Audio.jsx';
import UserReducer from '../reducers/userReducers';
import RoomReducer from '../reducers/roomReducers';
import NoteReducer from '../reducers/noteReducers';

class Review extends React.Component {
  constructor (props) {
    super(props);
    this.state = {
      loaded: false,
      thoughtButton: 'Show thoughts'
    };
  }
  componentWillMount() {
    var realm = this;
    var user = this.props.user.information[0];
    var pathUrl = this.props.params.roomId;
    this.props.dispatch(setRoomInfo(pathUrl, user, (err, success) => {
      if (err) {
        realm.context.router.push('/notebook');
      } else {
        realm.setState({loaded: true});
      }
    }));
    this.props.dispatch(showHideThoughts(true));
  }

  static get contextTypes() {
    return {
      router: React.PropTypes.object.isRequired,
    };
  }

  goToCompiledView() {
    this.context.router.push(`/compile/${this.props.room.roomInfo.pathUrl}`);
  }

  toggleThoughts() {
    if (this.state.thoughtButton === 'Show thoughts') {
      this.setState({
        thoughtButton: 'Hide thoughts'
      })
    } else {
      this.setState({
        thoughtButton: 'Show thoughts'
      })
    }
    this.props.dispatch(showHideThoughts());
  }

  render() {
    return (
      this.state.loaded ? (
      <div className="container">
        <div className="col-sm-8 panel panel-default">
          <LectureTitle />
          <NoteList />
        </div>
        <div className="col-sm-4">
          <button className="btn btn-md btn-primary" onClick={this.goToCompiledView.bind(this)}>
            Add / Edit Notes
          </button>
          <button className="btn btn-md btn-info" onClick={this.toggleThoughts.bind(this)}>
            {this.state.thoughtButton}
          </button>
          <ThoughtList />
        </div>
      </div>
    ) : (<div></div>)
    );
  }
}

const mapStateToProps = (state) => {
  return {
    ...state,
    UserReducer,
    RoomReducer,
    NoteReducer
  };
};

export default connect(mapStateToProps)(Review);
{'fraction_non_alphanumeric': 0.1468155500413565, 'fraction_numerical': 0.0014474772539288668, 'mean_word_length': 2.650566037735849, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 36, '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': '1663636', 'n_tokens_mistral': 1522, 'n_tokens_neox': 1500, 'n_words': 301}