<commit_before>import classNames                 from 'classnames';
import PropTypes                  from 'prop-types';
import React                      from 'react';
import { localize }               from '_common/localize';
import Button                     from 'App/Components/Form/button.jsx';
import { IconTradeType }          from 'Assets/Trading/Types';
import { getContractTypeDisplay } from 'Constants/contract';

const PurchaseButton = ({
    info,
    is_contract_mode,
    is_disabled,
    is_high_low,
    is_loading,
    onClickPurchase,
    type,
}) => (
    <Button
        is_disabled={is_contract_mode || is_disabled}
        id={`purchase_${type}`}
        className={classNames(
            'btn-purchase',
            { 'btn-purchase--disabled': (is_contract_mode || is_disabled) && !is_loading },
            { 'btn-purchase--animated': is_loading })}
        has_effect
        onClick={() => { onClickPurchase(info.id, info.stake, type); }}
    >
        <React.Fragment>
            <div className='btn-purchase__info btn-purchase__info--left'>
                <div className='btn-purchase__icon_wrapper'>
                    <IconTradeType
                        className='btn-purchase__icon'
                        type={!is_loading
                            ? (is_high_low
                                ? `${type.toLowerCase()}_barrier`
                                : type.toLowerCase())
                            : ''}
                    />
                </div>
                <div className='btn-purchase__text_wrapper'>
                    <span className='btn-purchase__text'>{!is_loading && localize('[_1]', getContractTypeDisplay(type, is_high_low))}</span>
                </div>
            </div>
            <div className='btn-purchase__effect-detail' />
            <div className='btn-purchase__info btn-purchase__info--right'>
                <div className='btn-purchase__text_wrapper'>
                    <span className='btn-purchase__text'>{is_loading && is_disabled ? '' : info.returns}</span>
                </div>
            </div>
        </React.Fragment>
    </Button>
);

PurchaseButton.propTypes = {
    currency        : PropTypes.string,
    info            : PropTypes.object,<commit_msg>purchase-button : fix number showing when button is disabled<commit_after>import classNames                 from 'classnames';
import PropTypes                  from 'prop-types';
import React                      from 'react';
import { localize }               from '_common/localize';
import Button                     from 'App/Components/Form/button.jsx';
import { IconTradeType }          from 'Assets/Trading/Types';
import { getContractTypeDisplay } from 'Constants/contract';

const PurchaseButton = ({
    info,
    is_contract_mode,
    is_disabled,
    is_high_low,
    is_loading,
    onClickPurchase,
    type,
}) => (
    <Button
        is_disabled={is_contract_mode || is_disabled}
        id={`purchase_${type}`}
        className={classNames(
            'btn-purchase',
            { 'btn-purchase--disabled': (is_contract_mode || is_disabled) && !is_loading },
            { 'btn-purchase--animated': is_loading })}
        has_effect
        onClick={() => { onClickPurchase(info.id, info.stake, type); }}
    >
        <React.Fragment>
            <div className='btn-purchase__info btn-purchase__info--left'>
                <div className='btn-purchase__icon_wrapper'>
                    <IconTradeType
                        className='btn-purchase__icon'
                        type={!is_loading
                            ? (is_high_low
                                ? `${type.toLowerCase()}_barrier`
                                : type.toLowerCase())
                            : ''}
                    />
                </div>
                <div className='btn-purchase__text_wrapper'>
                    <span className='btn-purchase__text'>{!is_loading && localize('[_1]', getContractTypeDisplay(type, is_high_low))}</span>
                </div>
            </div>
            <div className='btn-purchase__effect-detail' />
            <div className='btn-purchase__info btn-purchase__info--right'>
                <div className='btn-purchase__text_wrapper'>
                    <span className='btn-purchase__text'>{is_loading || is_disabled ? '' : info.returns}</span>
                </div>
            </div>
        </React.Fragment>
    </Button>
);

PurchaseButton.propTypes = {
    currency        : PropTypes.string,
    info            : PropTypes.object,
{'fraction_non_alphanumeric': 0.11831477843265663, 'fraction_numerical': 0.0004365858982754857, 'mean_word_length': 1.6858147713950762, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6274880', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1217, 'n_words': 198}