2018-04-07 00:29:51 +02:00
|
|
|
import React, { Component } from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
2018-05-01 04:42:57 +02:00
|
|
|
import PageContainerHeader from '../../page-container/page-container-header'
|
2018-04-30 17:30:51 +02:00
|
|
|
import { DEFAULT_ROUTE } from '../../../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-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
|
2018-05-07 14:03:20 +02:00
|
|
|
onClose={() => this.onClose()}
|
2018-05-24 21:57:33 +02:00
|
|
|
subtitle={this.context.t(...this.props.subtitleParams)}
|
|
|
|
title={this.context.t(this.props.titleKey)}
|
2018-04-07 00:29:51 +02:00
|
|
|
/>
|
2018-04-27 02:38:14 +02:00
|
|
|
)
|
2018-04-07 00:29:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
SendHeader.contextTypes = {
|
|
|
|
t: PropTypes.func,
|
|
|
|
}
|