{"size": 1367, "ext": "js", "max_stars_repo_path": "src/components/Exchange.js", "max_stars_repo_name": "deckmon/fastx-demo-dex", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/Exchange.js", "max_issues_repo_name": "deckmon/fastx-demo-dex", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/Exchange.js", "max_forks_repo_name": "deckmon/fastx-demo-dex", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.085106383, "max_line_length": 76, "alphanum_fraction": 0.4703730797}
import React, { Component } from 'react';
import SetTrade from './SetTrade';
import DoTrade from './DoTrade';
import { Grid, Message } from 'semantic-ui-react'

export default class Exchange extends Component {

    render() {
        let transactions = this.props.transaction
        let transactionChange = this.props.transactionChange
        let transactionHtml = transactions.map(function(v,index){
            let content = `You have bought ${v.fastx} FEX with ${v.eth} ETH`
            const handleDismiss = ()=>{
              transactions.splice(index, 1)
              transactionChange(transactions)
            }
            return <Message
            onDismiss={handleDismiss}
            content={content}
            key={index}
          />
        })

        return (
          <React.Fragment>
            {
              // this.props.step === 1 
              // ?
              // <SetTrade {...this.props} />
              // :
              // <DoTrade {...this.props} />
            }
            <Grid columns={2}>
              <Grid.Row>
                <Grid.Column>
                  <SetTrade {...this.props} />
                </Grid.Column>
                <Grid.Column>
                  {transactionHtml}
                </Grid.Column>
              </Grid.Row>
            </Grid> 
          </React.Fragment>
        );
    };
}
