{"size": 799, "ext": "js", "max_stars_repo_path": "ui/app/pages/swap/swap-header/swap-header.component.js", "max_stars_repo_name": "Pio1006/ethereum-remote-client", "max_stars_repo_stars_event_min_datetime": "2019-04-15T21:03:08.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-05T04:03:13.000Z", "max_issues_repo_path": "ui/app/pages/swap/swap-header/swap-header.component.js", "max_issues_repo_name": "NullHypothesis/ethereum-remote-client", "max_issues_repo_issues_event_min_datetime": "2019-06-06T20:10:10.000Z", "max_issues_repo_issues_event_max_datetime": "2021-11-16T13:30:02.000Z", "max_forks_repo_path": "ui/app/pages/swap/swap-header/swap-header.component.js", "max_forks_repo_name": "SaintPatricks-Github-Coinpot-Club/ethereum-remote-client", "max_forks_repo_forks_event_min_datetime": "2019-06-17T21:16:17.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-09T11:37:46.000Z"}
{"max_stars_count": 44, "max_issues_count": 59, "max_forks_count": 34, "avg_line_length": 22.8285714286, "max_line_length": 93, "alphanum_fraction": 0.6595744681}
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import PageContainerHeader from '../../../components/ui/page-container/page-container-header'

export default class SwapHeader extends Component {

  static propTypes = {
    clearSwap: PropTypes.func,
    history: PropTypes.object,
    mostRecentOverviewPage: PropTypes.string,
  }

  static contextTypes = {
    t: PropTypes.func,
  }

  onClose () {
    const { clearSwap, history, mostRecentOverviewPage } = this.props
    clearSwap()
    history.push(mostRecentOverviewPage)
  }

  render () {
    return (
      <PageContainerHeader
        className="swap__header"
        onClose={() => this.onClose()}
        title={this.context.t('swap')}
        headerCloseText={this.context.t('cancel')}
      />
    )
  }

}
