aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send_/send-header
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-04-07 06:29:51 +0800
committerDan <danjm.com@gmail.com>2018-04-07 06:29:51 +0800
commit284dd85a99f538b77fd477f4952117d1792f64a5 (patch)
tree419bc3a56f01d818a98a6bb3ff21cec8434be093 /ui/app/components/send_/send-header
parent77486a23654a7709091f99bc7ef76d894a46113a (diff)
downloadtangerine-wallet-browser-284dd85a99f538b77fd477f4952117d1792f64a5.tar.gz
tangerine-wallet-browser-284dd85a99f538b77fd477f4952117d1792f64a5.tar.zst
tangerine-wallet-browser-284dd85a99f538b77fd477f4952117d1792f64a5.zip
first commit
Diffstat (limited to 'ui/app/components/send_/send-header')
-rw-r--r--ui/app/components/send_/send-header/README.md0
-rw-r--r--ui/app/components/send_/send-header/send-header.component.js32
-rw-r--r--ui/app/components/send_/send-header/send-header.container.js19
-rw-r--r--ui/app/components/send_/send-header/tests/send-header-component.test.js0
-rw-r--r--ui/app/components/send_/send-header/tests/send-header-container.test.js0
5 files changed, 51 insertions, 0 deletions
diff --git a/ui/app/components/send_/send-header/README.md b/ui/app/components/send_/send-header/README.md
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/ui/app/components/send_/send-header/README.md
diff --git a/ui/app/components/send_/send-header/send-header.component.js b/ui/app/components/send_/send-header/send-header.component.js
new file mode 100644
index 000000000..99adfc7e8
--- /dev/null
+++ b/ui/app/components/send_/send-header/send-header.component.js
@@ -0,0 +1,32 @@
+import React, { Component } from 'react'
+import PropTypes from 'prop-types'
+import PageContainerHeader from '../../page-container/page-container-header.component'
+
+export default class SendHeader extends Component {
+
+ static propTypes = {
+ isToken: PropTypes.bool,
+ clearSend: PropTypes.func,
+ goHome: PropTypes.func,
+ };
+
+ render () {
+ const { isToken, clearSend, goHome } = this.props
+
+ return (
+ <PageContainerHeader
+ title={isToken ? this.context.t('sendTokens') : this.context.t('sendETH')}
+ subtitle={this.context.t('onlySendToEtherAddress')}
+ onClose={() => {
+ clearSend()
+ goHome()
+ }}
+ />
+ );
+ }
+
+}
+
+SendHeader.contextTypes = {
+ t: PropTypes.func,
+}
diff --git a/ui/app/components/send_/send-header/send-header.container.js b/ui/app/components/send_/send-header/send-header.container.js
new file mode 100644
index 000000000..a4d3ac54f
--- /dev/null
+++ b/ui/app/components/send_/send-header/send-header.container.js
@@ -0,0 +1,19 @@
+import { connect } from 'react-redux'
+import { goHome, clearSend } from '../../../actions'
+import SendHeader from './send-header.component'
+import { getSelectedToken } from '../../../selectors'
+
+export default connect(mapStateToProps, mapDispatchToProps)(SendHeader)
+
+function mapStateToProps (state) {
+ return {
+ isToken: Boolean(getSelectedToken(state))
+ }
+}
+
+function mapDispatchToProps (dispatch) {
+ return {
+ goHome: () => dispatch(goHome()),
+ clearSend: () => dispatch(clearSend()),
+ }
+}
diff --git a/ui/app/components/send_/send-header/tests/send-header-component.test.js b/ui/app/components/send_/send-header/tests/send-header-component.test.js
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/ui/app/components/send_/send-header/tests/send-header-component.test.js
diff --git a/ui/app/components/send_/send-header/tests/send-header-container.test.js b/ui/app/components/send_/send-header/tests/send-header-container.test.js
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/ui/app/components/send_/send-header/tests/send-header-container.test.js