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

34 lines
786 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,
isToken: PropTypes.bool,
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('onlySendToEtherAddress')}
title={this.props.isToken ? this.context.t('sendTokens') : this.context.t('sendETH')}
2018-04-07 00:29:51 +02:00
/>
)
2018-04-07 00:29:51 +02:00
}
}
SendHeader.contextTypes = {
t: PropTypes.func,
}