<commit_before>import React from 'react'
import { Link } from 'react-router-dom'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as actionCreators from '../../actions/careButtonActionCreators'

import Tooltip from '../Tooltip'
import css from './CareButton.scss'

class CareButton extends React.Component {

	renderTooltip() {
		if (this.props.tooltipVisible) {
			return <Tooltip style="tooltip care-button-tooltip" text="Click here to follow the charities progress" /> 
		} else {
			return <Tooltip style="tooltip care-button-tooltip hidden" text="Click here to follow the charities progress"/>
		}
	}

	render() {
		return (
			<div className="care-button">
				<button onMouseEnter={this.props.toggleTooltip} onMouseLeave={this.props.toggleTooltip}>
					{this.renderTooltip()}
					<i className="fa fa-heart-o"></i>
					Care
				</button>	
				<div className="care-count-wrapper">
					<div className="care-count-square"></div>
					<p>222</p>
				</div>
			</div>
		)
	}
}

function mapStateToProps(state, routing) {
  return Object.assign({}, state.careButton, routing)
}

// this is attaching our actions to the Navigation component<commit_msg>refactor carebutton component<commit_after>import React from 'react'
import { Link } from 'react-router-dom'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import * as actionCreators from '../../actions/careButtonActionCreators'

import Tooltip from '../Tooltip'
import css from './CareButton.scss'

class CareButton extends React.Component {

	createTooltipStyle() {
		return this.props.tooltipVisible ? "tooltip care-button-tooltip" : "tooltip care-button-tooltip hidden"
	}

	render() {
		return (
			<div className="care-button">
				<button onMouseEnter={this.props.toggleTooltip} onMouseLeave={this.props.toggleTooltip}>
					<Tooltip style={this.createTooltipStyle()} text="Click here to follow the charities progress" />
					<i className="fa fa-heart-o"></i>
					Care
				</button>	
				<div className="care-count-wrapper">
					<div className="care-count-square"></div>
					<p>222</p>
				</div>
			</div>
		)
	}
}

function mapStateToProps(state, routing) {
  return { ...state.careButton, ...routing }
}

{'fraction_non_alphanumeric': 0.13923487544483987, 'fraction_numerical': 0.0026690391459074734, 'mean_word_length': 3.932017543859649, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, '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': '912034', 'n_tokens_mistral': 771, 'n_tokens_neox': 683, 'n_words': 172}