2018-04-07 00:29:51 +02:00
|
|
|
import React, { Component } from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
2019-04-17 21:15:13 +02:00
|
|
|
import PageContainerHeader from '../../../components/ui/page-container/page-container-header'
|
|
|
|
import { DEFAULT_ROUTE } from '../../../helpers/constants/routes'
|
2018-04-07 00:29:51 +02:00
|
|
|
|
|
|
|
export default class SendHeader extends Component {
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
clearSend: PropTypes.func,
|
2018-04-30 17:30:51 +02:00
|
|
|
history: PropTypes.object,
|
2018-05-24 21:57:33 +02:00
|
|
|
titleKey: PropTypes.string,
|
|
|
|
subtitleParams: PropTypes.array,
|
2018-04-07 00:29:51 +02:00
|
|
|
};
|
|
|
|
|
2018-07-02 04:09:28 +02:00
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
|
|
|
};
|
|
|
|
|
2018-05-07 14:03:20 +02:00
|
|
|
onClose () {
|
|
|
|
this.props.clearSend()
|
|
|
|
this.props.history.push(DEFAULT_ROUTE)
|
|
|
|
}
|
2018-04-07 00:29:51 +02:00
|
|
|
|
2018-05-07 14:03:20 +02:00
|
|
|
render () {
|
2018-04-07 00:29:51 +02:00
|
|
|
return (
|
|
|
|
<PageContainerHeader
|
2019-07-31 21:56:44 +02:00
|
|
|
className="send__header"
|
2018-05-07 14:03:20 +02:00
|
|
|
onClose={() => this.onClose()}
|
2018-05-24 21:57:33 +02:00
|
|
|
title={this.context.t(this.props.titleKey)}
|
2019-07-31 21:56:44 +02:00
|
|
|
headerCloseText={this.context.t('cancel')}
|
2018-04-07 00:29:51 +02:00
|
|
|
/>
|
2018-04-27 02:38:14 +02:00
|
|
|
)
|
2018-04-07 00:29:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|