1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 19:10:22 +01:00
metamask-extension/ui/app/components/send_/send-header/send-header.component.js

35 lines
788 B
JavaScript
Raw Normal View History

2018-04-07 00:29:51 +02:00
import React, { Component } from 'react'
import PropTypes from 'prop-types'
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,
titleKey: PropTypes.string,
subtitleParams: PropTypes.array,
2018-04-07 00:29:51 +02:00
};
onClose () {
this.props.clearSend()
this.props.history.push(DEFAULT_ROUTE)
}
2018-04-07 00:29:51 +02:00
render () {
2018-04-07 00:29:51 +02:00
return (
<PageContainerHeader
onClose={() => this.onClose()}
subtitle={this.context.t(...this.props.subtitleParams)}
title={this.context.t(this.props.titleKey)}
2018-04-07 00:29:51 +02:00
/>
)
2018-04-07 00:29:51 +02:00
}
}
SendHeader.contextTypes = {
t: PropTypes.func,
}