<commit_before>import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {Modal, Button} from 'react-bootstrap'
import EtherDisplay from "./EtherDisplay"


class FundOrderResultModal extends Component {

    render() {
        if (this.props.transaction===null) {
            return <div></div>
        }

        let verifyUrl = 'https://etherchain.org/tx/' + this.props.transaction.hash

        const modal = (
            <Modal bsSize="small" show={this.props.showModal} onHide={this.props.onClose}>
                <Modal.Header closeButton>
                    <Modal.Title>Funding successfull</Modal.Title>
                </Modal.Header>
                <Modal.Body>
                    <p>Sent <EtherDisplay wei={this.props.transaction.value}/>.</p>
                    <p><a href={verifyUrl} target="_blank">Verify on etherchain.org</a></p>
                </Modal.Body>
                <Modal.Footer>
                    <Button onClick={this.props.onClose}>Close</Button>
                </Modal.Footer>
            </Modal>
        )

        return modal
    }
}

FundOrderResultModal.propTypes = {
    //order: PropTypes.object.isRequired,
    //onWithdraw: PropTypes.func.isRequired,
    showModal: PropTypes.bool.isRequired,
    onClose: PropTypes.func.isRequired,
}

export default FundOrderResultModal<commit_msg>Display dummy funding result data when transaction details could not be retrieved. This seems only to happen with testrpc running with -b.<commit_after>import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {Modal, Button, Alert} from 'react-bootstrap'
import EtherDisplay from "./EtherDisplay"


class FundOrderResultModal extends Component {

    render() {
        if (this.props.transaction===null) {
            return <Modal bsSize="small" show={this.props.showModal} onHide={this.props.onClose}>
                <Modal.Header closeButton>
                    <Modal.Title>Funding successfull</Modal.Title>
                </Modal.Header>
                <Modal.Body>
                    <Alert bsStyle="warning">
                        <strong>Got empty transaction result. This is most likely a bug in testRPC when running with -b option (background mining).</strong>
                    </Alert>
                    <p>Sent XXX eth.</p>
                    <p><a href="#" target="_blank">Verify on etherchain.org</a></p>
                </Modal.Body>
                <Modal.Footer>
                    <Button onClick={this.props.onClose}>Close</Button>
                </Modal.Footer>
            </Modal>

        }

        let verifyUrl = 'https://etherchain.org/tx/' + this.props.transaction.hash

        const modal = (
            <Modal bsSize="small" show={this.props.showModal} onHide={this.props.onClose}>
                <Modal.Header closeButton>
                    <Modal.Title>Funding successfull</Modal.Title>
                </Modal.Header>
                <Modal.Body>
                    <p>Sent <EtherDisplay wei={this.props.transaction.value}/>.</p>
                    <p><a href={verifyUrl} target="_blank">Verify on etherchain.org</a></p>
                </Modal.Body>
                <Modal.Footer>
                    <Button onClick={this.props.onClose}>Close</Button>
                </Modal.Footer>
            </Modal>
        )

        return modal
    }
}

FundOrderResultModal.propTypes = {
    showModal: PropTypes.bool.isRequired,
    onClose: PropTypes.func.isRequired,
}

export default FundOrderResultModal
{'fraction_non_alphanumeric': 0.11952528962983894, 'fraction_numerical': 0.0, 'mean_word_length': 1.9524603836530443, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 65, 'https://': 2, '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': '5973444', 'n_tokens_mistral': 978, 'n_tokens_neox': 924, 'n_words': 204}