<commit_before>import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import _ from 'lodash';
import {
  unsavePost,
} from '../../actions/voz';
import LazyPost from './LazyPost';
import openNewTab from '../../utils/openNewTab';
import { toClassName } from '../../utils';

class SavedPostSideBarIcon extends Component {
  static propTypes = {
    dispatch: PropTypes.func,
    savedPosts: PropTypes.object,
  }

  constructor(comProps) {
    super(comProps);
    this.dispatch = comProps.dispatch;
    this.state = {
      showList: false,
      showFullInfo: false,
    };
  }

  shouldComponentUpdate(nextProps, nextState) {
    return !_.isEqual(nextProps, this.props) || !_.isEqual(nextState, this.state);
  }

  openPostInNewTab(postId) {
    openNewTab(`/showthread.php?p=${postId}`);
    return false;
  }

  unsavePost(postId) {
    this.dispatch(unsavePost(postId));
    return false;
  }

  renderPost(postId, time) {
    const openInNewTab = this.openPostInNewTab.bind(this, postId);
    const unsavePostClick = this.unsavePost.bind(this, postId);
    return (
      <div className="bookmark-item-wrapper" key={postId}>
        <div className="bookmark-tools">
          <a href="#" className="bookmark-remove" onClick={unsavePostClick}>
            <i className="fa fa-trash" />
          </a>
          <a href="#" className="open-post-new-tab" onClick={openInNewTab}>
            <i className="fa fa-external-link" />
          </a>
        </div>
        <LazyPost postId={postId} />
      </div>
    );
  }

  render() {
    const { savedPosts } = this.props;

    return (
      <div className="btn-group">
        <div
          className={`btn tooltip-right ${(this.state.showList ? 'active' : '')}`}
          onClick={() => this.setState({ showList: !this.state.showList })}<commit_msg>fix link event handler<commit_after>import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import _ from 'lodash';
import {
  unsavePost,
} from '../../actions/voz';
import LazyPost from './LazyPost';
import openNewTab from '../../utils/openNewTab';
import { toClassName } from '../../utils';

class SavedPostSideBarIcon extends Component {
  static propTypes = {
    dispatch: PropTypes.func,
    savedPosts: PropTypes.object,
  }

  constructor(comProps) {
    super(comProps);
    this.dispatch = comProps.dispatch;
    this.state = {
      showList: false,
      showFullInfo: false,
    };
  }

  shouldComponentUpdate(nextProps, nextState) {
    return !_.isEqual(nextProps, this.props) || !_.isEqual(nextState, this.state);
  }

  openPostInNewTab(postId) {
    openNewTab(`/showthread.php?p=${postId}`);
    return false;
  }

  unsavePost(postId) {
    this.dispatch(unsavePost(postId));
    return false;
  }

  renderPost(postId, time) {
    const openInNewTab = this.openPostInNewTab.bind(this, postId);
    const unsavePostClick = this.unsavePost.bind(this, postId);
    return (
      <div className="bookmark-item-wrapper" key={postId}>
        <div className="bookmark-tools">
          <a href="javscript:void(0)" className="bookmark-remove" onClick={unsavePostClick}>
            <i className="fa fa-trash" />
          </a>
          <a href="javscript:void(0)" className="open-post-new-tab" onClick={openInNewTab}>
            <i className="fa fa-external-link" />
          </a>
        </div>
        <LazyPost postId={postId} />
      </div>
    );
  }

  render() {
    const { savedPosts } = this.props;

    return (
      <div className="btn-group">
        <div
          className={`btn tooltip-right ${(this.state.showList ? 'active' : '')}`}
          onClick={() => this.setState({ showList: !this.state.showList })}
{'fraction_non_alphanumeric': 0.15446500402252614, 'fraction_numerical': 0.0005363368195226602, 'mean_word_length': 2.9263157894736844, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '6256742', 'n_tokens_mistral': 1194, 'n_tokens_neox': 1195, 'n_words': 233}