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'
|
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,
|
2020-06-01 19:54:32 +02:00
|
|
|
mostRecentOverviewPage: PropTypes.string,
|
2018-05-24 21:57:33 +02:00
|
|
|
titleKey: PropTypes.string,
|
2020-01-07 21:10:44 +01:00
|
|
|
}
|
2018-04-07 00:29:51 +02:00
|
|
|
|
2018-07-02 04:09:28 +02:00
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
2020-01-07 21:10:44 +01:00
|
|
|
}
|
2018-07-02 04:09:28 +02:00
|
|
|
|
2018-05-07 14:03:20 +02:00
|
|
|
onClose () {
|
2020-06-01 19:54:32 +02:00
|
|
|
const { clearSend, history, mostRecentOverviewPage } = this.props
|
|
|
|
clearSend()
|
|
|
|
history.push(mostRecentOverviewPage)
|
2018-05-07 14:03:20 +02:00
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
|
|
|
}
|