<commit_before>import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';

import { selectPanel } from '../actions/PanelSelectActionCreators';
import { userCountSelector } from '../selectors/userSelectors';
import {
  sizeSelector as waitlistSizeSelector,
  positionSelector as waitlistPositionSelector
} from '../selectors/waitlistSelectors';

import SidePanels from '../components/SidePanels';

const mapStateToProps = createStructuredSelector({
  selectedPanel: state => state.selectedPanel,
  waitlistPosition: waitlistPositionSelector,
  waitlistSize: waitlistSizeSelector,
  onlineUsersCount: userCountSelector
});

function mapDispatchToProps(dispatch) {
  return bindActionCreators({
    onChange: selectPanel
  }, dispatch);
}

export default connect(mapStateToProps, mapDispatchToProps)(SidePanels);<commit_msg>chat: prevent chat input change from rerendering tabs<commit_after>import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';

import { selectPanel } from '../actions/PanelSelectActionCreators';
import { userCountSelector } from '../selectors/userSelectors';
import {
  sizeSelector as waitlistSizeSelector,
  positionSelector as waitlistPositionSelector
} from '../selectors/waitlistSelectors';

import SidePanels from '../components/SidePanels';

const mapStateToProps = createStructuredSelector({
  selectedPanel: state => state.selectedPanel,
  waitlistPosition: waitlistPositionSelector,
  waitlistSize: waitlistSizeSelector,
  onlineUsersCount: userCountSelector
});

function mapDispatchToProps(dispatch) {
  return {
    onChange: panelName => {
      // Ensure that we're actually switching panels--otherwise change events
      // from eg. the chat box bubble up and trigger a panel rerender on every
      // keypress.
      if (typeof panelName === 'string') {
        dispatch(selectPanel(panelName));
      }
    }
  };
}

export default connect(mapStateToProps, mapDispatchToProps)(SidePanels);
{'fraction_non_alphanumeric': 0.09607843137254903, 'fraction_numerical': 0.0, 'mean_word_length': 5.338509316770186, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '2825096', 'n_tokens_mistral': 538, 'n_tokens_neox': 535, 'n_words': 140}