<commit_before>import React from "react";
import {PropTypes} from "react/addons";
import Immutable from "immutable";
import Ps from "perfect-scrollbar";
import utils from "common/utils";
import Translate from "react-translate-component";
import market_utils from "common/market_utils";

class MarketHistory extends React.Component {
    shouldComponentUpdate(nextProps) {
        return (
            !Immutable.is(nextProps.history, this.props.history) ||
            nextProps.baseSymbol !== this.props.baseSymbol ||
            nextProps.quoteSymbol !== this.props.quoteSymbol
        );
    }

    componentDidMount() {
        let historyContainer = React.findDOMNode(this.refs.history);
        Ps.initialize(historyContainer);
    }

    componentDidUpdate() {
        let historyContainer = React.findDOMNode(this.refs.history);
        Ps.update(historyContainer);
    }

    render() {
        let {history, base, quote, baseSymbol, quoteSymbol, flipped} = this.props;
        let historyRows = null;
        if (history.size > 0) {
            let index = 0;
            let keyIndex = -1;
            let flipped = base.get("id").split(".")[2] > quote.get("id").split(".")[2];
            historyRows = this.props.history
            .filter(a => {
                index++;
                return index % 2 === 0;
            })
            .take(50)
            .map(order => {
                keyIndex++;
                let paysAsset, receivesAsset, isAsk = false;
                if (order.pays.asset_id === base.get("id")) {
                    paysAsset = base;
                    receivesAsset = quote;
                    isAsk = true;

                } else {
                    paysAsset = quote;
                    receivesAsset = base;
                }

                let parsed_order = market_utils.parse_order_history(order, paysAsset, receivesAsset, isAsk, flipped);

                return (
                    <tr key={keyIndex}>
                        <td className={parsed_order.className}><span className="price-integer">{parsed_order.int}</span>.<span className="price-decimal">{parsed_order.dec}</span></td>
                        <td>{parsed_order.pays}</td>
                        <td>{parsed_order.receives}</td>
                        <td data-tip={new Date(order.time)}>{parsed_order.time}</td>
                    </tr>
                );
            }).toArray();
        }

        return (
            <div className="left-order-book no-padding no-overflow">
                <div className="grid-block shrink left-orderbook-header market-right-padding-only">
                    <table className="table expand order-table text-right market-right-padding">
                        <thead>
                            <tr><commit_msg>Correct the Amount/Value columns in MarketHistory<commit_after>import React from "react";
import {PropTypes} from "react/addons";
import Immutable from "immutable";
import Ps from "perfect-scrollbar";
import utils from "common/utils";
import Translate from "react-translate-component";
import market_utils from "common/market_utils";

class MarketHistory extends React.Component {
    shouldComponentUpdate(nextProps) {
        return (
            !Immutable.is(nextProps.history, this.props.history) ||
            nextProps.baseSymbol !== this.props.baseSymbol ||
            nextProps.quoteSymbol !== this.props.quoteSymbol
        );
    }

    componentDidMount() {
        let historyContainer = React.findDOMNode(this.refs.history);
        Ps.initialize(historyContainer);
    }

    componentDidUpdate() {
        let historyContainer = React.findDOMNode(this.refs.history);
        Ps.update(historyContainer);
    }

    render() {
        let {history, base, quote, baseSymbol, quoteSymbol, flipped} = this.props;
        let historyRows = null;
        if (history.size > 0) {
            let index = 0;
            let keyIndex = -1;
            let flipped = base.get("id").split(".")[2] > quote.get("id").split(".")[2];
            historyRows = this.props.history
            .filter(a => {
                index++;
                return index % 2 === 0;
            })
            .take(50)
            .map(order => {
                keyIndex++;
                let paysAsset, receivesAsset, isAsk = false;
                if (order.pays.asset_id === base.get("id")) {
                    paysAsset = base;
                    receivesAsset = quote;
                    isAsk = true;

                } else {
                    paysAsset = quote;
                    receivesAsset = base;
                }

                let parsed_order = market_utils.parse_order_history(order, paysAsset, receivesAsset, isAsk, flipped);

                return (
                    <tr key={keyIndex}>
                        <td className={parsed_order.className}><span className="price-integer">{parsed_order.int}</span>.<span className="price-decimal">{parsed_order.dec}</span></td>
                        <td>{parsed_order.receives}</td>
                        <td>{parsed_order.pays}</td>
                        <td data-tip={new Date(order.time)}>{parsed_order.time}</td>
                    </tr>
                );
            }).toArray();
        }

        return (
            <div className="left-order-book no-padding no-overflow">
                <div className="grid-block shrink left-orderbook-header market-right-padding-only">
                    <table className="table expand order-table text-right market-right-padding">
                        <thead>
                            <tr>
{'fraction_non_alphanumeric': 0.11925133689839572, 'fraction_numerical': 0.0032085561497326204, 'mean_word_length': 1.7119381343644273, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 49, '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': '361896', 'n_tokens_mistral': 1502, 'n_tokens_neox': 1428, 'n_words': 292}