aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/pages/send/send-header/send-header.component.js
blob: 02bda383e4c45061ec63f817c68feb18fc672eca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import PageContainerHeader from '../../../components/ui/page-container/page-container-header'
import { DEFAULT_ROUTE } from '../../../helpers/constants/routes'

export default class SendHeader extends Component {

  static propTypes = {
    clearSend: PropTypes.func,
    history: PropTypes.object,
    titleKey: PropTypes.string,
    subtitleParams: PropTypes.array,
  };

  static contextTypes = {
    t: PropTypes.func,
  };

  onClose () {
    this.props.clearSend()
    this.props.history.push(DEFAULT_ROUTE)
  }

  render () {
    return (
      <PageContainerHeader
        onClose={() => this.onClose()}
        subtitle={this.context.t(...this.props.subtitleParams)}
        title={this.context.t(this.props.titleKey)}
      />
    )
  }

}