<commit_before>import './Tooltip.styles'
import React, { PureComponent, PropTypes } from 'react';
import cx from 'classnames';

import { bindMembersToClass } from '~/utils';


export default class Tooltip extends PureComponent {

    static defaultProps = {
        className: '',
        position: 'top',
        tooltip: 'No tooltip provided',
        effect: 'scale',
    };

    static propTypes = {
        className: PropTypes.string,
        position: PropTypes.oneOf([
            'top', 'bottom', 'left', 'right'
        ]),
        effect: PropTypes.oneOf([
            'fade', 'scale'
        ]),
        tooltip: PropTypes.oneOfType([
            PropTypes.string,
            PropTypes.element
        ]),
    };

    constructor(props) {
        super(props);

        bindMembersToClass(this,
            'show',
            'hide',
            'onMouseEnter',
            'onMouseLeave'
        )

        this.state = {
            isVisible: false
        }
    }

    onMouseEnter(e) {
        this.show(this.props.onMouseEnter)
    }

    onMouseLeave(e) {
        this.hide(this.props.onMouseLeave)
    }

    show(callback) {
        this.setState({isVisible: true}, () => {
            if (typeof this.props.onMouseEnter !== 'undefined') {
                callback()
            }
        })
    }

    hide(callback) {
        this.setState({isVisible: false}, () => {
            if (typeof this.props.onMouseEnter !== 'undefined') {
                callback()
            }
        })
    }

    render() {
        const { tooltip, className, children, position:pos, ...restProps } = this.props
        const mainClass = cx('Tooltip', {
            'Tooltip--active': this.state.isVisible
        })

        const wrapperClass = cx(
            className,
            "Tooltip__wrap",
            `Tooltip__content--effect-${this.props.effect}`
        )

        const contentClass = cx(
            'Tooltip__content',
            `Tooltip__wrap--${pos}`,
        )

        return (
            <div {...restProps}
            className='Tooltip'
            onMouseEnter={this.onMouseEnter}
            onMouseLeave={this.onMouseLeave}>
                <div className={wrapperClass}>
                    <div className={contentClass}>
                        {tooltip}
                    </div>
                </div>
                {children}
            </div>
        )
    }
}<commit_msg>fix(Tooltip): Stop react warning because of effect prop<commit_after>import './Tooltip.styles'
import React, { PureComponent, PropTypes } from 'react';
import cx from 'classnames';

import { bindMembersToClass } from '~/utils';


export default class Tooltip extends PureComponent {

    static defaultProps = {
        className: '',
        position: 'top',
        content: 'No tooltip provided',
        effect: 'scale',
    };

    static propTypes = {
        className: PropTypes.string,
        position: PropTypes.oneOf([
            'top', 'bottom', 'left', 'right'
        ]),
        effect: PropTypes.oneOf([
            'fade', 'scale'
        ]),
        content: PropTypes.oneOfType([
            PropTypes.string,
            PropTypes.element
        ]),
    };

    constructor(props) {
        super(props);

        bindMembersToClass(this,
            'show',
            'hide',
            'onMouseEnter',
            'onMouseLeave'
        )

        this.state = {
            isVisible: false
        }
    }

    onMouseEnter(e) {
        this.show(this.props.onMouseEnter)
    }

    onMouseLeave(e) {
        this.hide(this.props.onMouseLeave)
    }

    show(callback) {
        this.setState({isVisible: true}, () => {
            if (typeof this.props.onMouseEnter !== 'undefined') {
                callback()
            }
        })
    }

    hide(callback) {
        this.setState({isVisible: false}, () => {
            if (typeof this.props.onMouseEnter !== 'undefined') {
                callback()
            }
        })
    }

    render() {
        const { content, className, children, effect, position:pos, ...restProps } = this.props
        const mainClass = cx('Tooltip', {
            'Tooltip--active': this.state.isVisible
        })

        const wrapperClass = cx(
            className,
            "Tooltip__wrap",
            `Tooltip__content--effect-${this.props.effect}`
        )

        const contentClass = cx(
            'Tooltip__content',
            `Tooltip__wrap--${pos}`,
        )

        return (
            <div {...restProps}
            className='Tooltip'
            onMouseEnter={this.onMouseEnter}
            onMouseLeave={this.onMouseLeave}>
                <div className={wrapperClass}>
                    <div className={contentClass}>
                        {content}
                    </div>
                </div>
                {children}
            </div>
        )
    }
}
{'fraction_non_alphanumeric': 0.12448979591836734, 'fraction_numerical': 0.0, 'mean_word_length': 1.4815189873417722, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, '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': '4104327', 'n_tokens_mistral': 1324, 'n_tokens_neox': 1299, 'n_words': 248}