<commit_before>import React from 'react';
import * as cmsActions from '../actions/cmsActions';

const FilterLink = ({filter, children}) => {
  return (<a href="#" onClick={e => {
    e.preventDefault();
    this.props.actions.visibilityFilter(this.props.cmsAppState, filter);
  }}>
    {children}
  </a>);
};

export default FilterLink;<commit_msg>Bind visibilityFilter to the redux actions<commit_after>import React from 'react';
import * as cmsActions from '../actions/cmsActions';
import { connect } from 'react-redux';

const FilterLink = ({filter, children}) => {
  return (<a href="#" onClick={e => {
    e.preventDefault();
    this.props.actions.visibilityFilter(this.props.cmsAppState, filter);
  }}>
    {children}
  </a>);
};

const visibilityFilter = (state = 'SHOW_ALL', action) => {
  switch(action.type) {
    case 'SHOW_ALL':
      return action.filter;
    default:
      return state;
  }
};

import { bindActionCreators } from 'redux';

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

function mapDispatchToProps(dispatch) {
  return bindActionCreators({ visibilityFilter }, dispatch);
}

connect(mapStateToProps, mapDispatchToProps)(FilterLink);

export default FilterLink;
{'fraction_non_alphanumeric': 0.1466992665036675, 'fraction_numerical': 0.0, 'mean_word_length': 4.5565610859728505, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 12, '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': '6484587', 'n_tokens_mistral': 379, 'n_tokens_neox': 373, 'n_words': 88}