2021-02-04 19:15:23 +01:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
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,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-04-07 00:29:51 +02:00
|
|
|
|
2018-07-02 04:09:28 +02:00
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-07-02 04:09:28 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
onClose() {
|
2021-02-04 19:15:23 +01: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
|
|
|
|
2020-11-03 00:41:28 +01: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
|
|
|
/>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-04-07 00:29:51 +02:00
|
|
|
}
|
|
|
|
}
|