<commit_before>import React, { Component } from 'react';
import { connect } from 'react-redux';
import { getItem } from '../reducers/cart';

// userId getting passed in through props, will bomId or need grab bomId in db

class Product extends Component {

    constructor(props) {
        super(props);
        this.state = {
            quantity: 1
        }
        this.handleAddQuantity = this.handleAddQuantity.bind(this);
        this.handleMinusQuantity = this.handleMinusQuantity.bind(this);
        this.handleChange = this.handleChange.bind(this);
    }

    handleAddQuantity() {
        this.setState({
            quantity: this.state.quantity + 1
        })
        console.log('the quantity is? ', this.state.quantity);
    }

    handleMinusQuantity() {
        if (this.state.quantity - 1) {
            this.setState({
                quantity: this.state.quantity - 1
            })
        }
        console.log('minus.. ', this.state.quantity)
    }

    handleChange(evt) {
        const value = evt.target.value;
        if (!value.match(/[^0-9"]/)) {
            this.setState({
                quantity: +value
            })
        }
    }

    render() {
        const product = this.props.selectedProduct;
        const addItemToCart = this.props.getItem;<commit_msg>product is ready<commit_after>import React, { Component } from 'react';
import { connect } from 'react-redux';
import { getItem } from '../reducers/cart';

// userId getting passed in through props, will bomId or need grab bomId in db

class Product extends Component {

    constructor(props) {
        super(props);
        this.state = {
            quantity: 1
        }
        this.handleAddQuantity = this.handleAddQuantity.bind(this);
        this.handleMinusQuantity = this.handleMinusQuantity.bind(this);
        this.handleChange = this.handleChange.bind(this);
    }

    handleAddQuantity() {
        this.setState({
            quantity: this.state.quantity + 1
        })
        console.log('the quantity is? ', this.state.quantity);
    }

    handleMinusQuantity() {
        if (this.state.quantity - 1) {
            this.setState({
                quantity: parseInt(this.state.quantity - 1)
            })
        }
        console.log('minus.. ', this.state.quantity)
    }

    handleChange(evt) {
        const value = evt.target.value;
        if (value === "") {
            this.setState({
                quantity: ""
            })
        }
        else {
            if (!value.match(/[^0-9"]/)) {
                this.setState({
                    quantity: +value
                })
            }

        }
    }

    render() {
        const product = this.props.selectedProduct;
        const addItemToCart = this.props.getItem;
{'fraction_non_alphanumeric': 0.11988409996378124, 'fraction_numerical': 0.004346251358203549, 'mean_word_length': 1.7730923694779117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2102103', 'n_tokens_mistral': 792, 'n_tokens_neox': 754, 'n_words': 160}