aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-07-17 06:43:32 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-07-18 20:22:36 +0800
commit9ea7411c063712825780110c10252155ccb61e44 (patch)
tree5e17cb926dc7efb27e84a85d45f61f5a38200eba /ui
parent25417fad26566ca3f6e3ccbc4bf6508239f90e58 (diff)
downloadtangerine-wallet-browser-9ea7411c063712825780110c10252155ccb61e44.tar
tangerine-wallet-browser-9ea7411c063712825780110c10252155ccb61e44.tar.gz
tangerine-wallet-browser-9ea7411c063712825780110c10252155ccb61e44.tar.bz2
tangerine-wallet-browser-9ea7411c063712825780110c10252155ccb61e44.tar.lz
tangerine-wallet-browser-9ea7411c063712825780110c10252155ccb61e44.tar.xz
tangerine-wallet-browser-9ea7411c063712825780110c10252155ccb61e44.tar.zst
tangerine-wallet-browser-9ea7411c063712825780110c10252155ccb61e44.zip
Hook up send component w/ UPDATE_SEND_HEX_DATA action
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/send/send-content/send-hex-data-row/index.js2
-rw-r--r--ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.component.js10
-rw-r--r--ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.container.js21
3 files changed, 28 insertions, 5 deletions
diff --git a/ui/app/components/send/send-content/send-hex-data-row/index.js b/ui/app/components/send/send-content/send-hex-data-row/index.js
index 4371ef83d..08c341067 100644
--- a/ui/app/components/send/send-content/send-hex-data-row/index.js
+++ b/ui/app/components/send/send-content/send-hex-data-row/index.js
@@ -1 +1 @@
-export { default } from './send-hex-data-row.component'
+export { default } from './send-hex-data-row.container'
diff --git a/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.component.js b/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.component.js
index eaffce359..18d955c72 100644
--- a/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.component.js
+++ b/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.component.js
@@ -6,6 +6,7 @@ export default class SendHexDataRow extends Component {
static propTypes = {
data: PropTypes.string,
inError: PropTypes.bool,
+ updateSendHexData: PropTypes.func.isRequired,
};
static contextTypes = {
@@ -13,17 +14,18 @@ export default class SendHexDataRow extends Component {
};
onInput = (event) => {
+ const {updateSendHexData} = this.props
event.target.value = event.target.value.replace(/\n/g, '')
+ updateSendHexData(event.target.value)
}
render () {
- const {
- inError,
- } = this.props
+ const {inError} = this.props
+ const {t} = this.context
return (
<SendRowWrapper
- label={`${this.context.t('hexData')}:`}
+ label={`${t('hexData')}:`}
showError={inError}
errorType={'amount'}
>
diff --git a/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.container.js b/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.container.js
index e69de29bb..df554ca5f 100644
--- a/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.container.js
+++ b/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.container.js
@@ -0,0 +1,21 @@
+import { connect } from 'react-redux'
+import {
+ updateSendHexData,
+} from '../../../../actions'
+import SendHexDataRow from './send-hex-data-row.component'
+
+export default connect(mapStateToProps, mapDispatchToProps)(SendHexDataRow)
+
+function mapStateToProps (state) {
+ return {
+ data: state.metamask.send.data,
+ }
+}
+
+function mapDispatchToProps (dispatch) {
+ return {
+ updateSendHexData (data) {
+ return dispatch(updateSendHexData(data))
+ },
+ }
+}