diff options
author | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-07-17 04:51:02 +0800 |
---|---|---|
committer | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2018-07-18 20:22:13 +0800 |
commit | 3f9c3d76b6edb70f91363c1e0787707ed1440c41 (patch) | |
tree | fdf98043ed205970c53f334240f27934ef3e80ed /ui/app/components/send/send-content | |
parent | f6ca06f775a739c8b449405c5e96b03151a6a33c (diff) | |
download | tangerine-wallet-browser-3f9c3d76b6edb70f91363c1e0787707ed1440c41.tar tangerine-wallet-browser-3f9c3d76b6edb70f91363c1e0787707ed1440c41.tar.gz tangerine-wallet-browser-3f9c3d76b6edb70f91363c1e0787707ed1440c41.tar.bz2 tangerine-wallet-browser-3f9c3d76b6edb70f91363c1e0787707ed1440c41.tar.lz tangerine-wallet-browser-3f9c3d76b6edb70f91363c1e0787707ed1440c41.tar.xz tangerine-wallet-browser-3f9c3d76b6edb70f91363c1e0787707ed1440c41.tar.zst tangerine-wallet-browser-3f9c3d76b6edb70f91363c1e0787707ed1440c41.zip |
Add hex data row to send screen
Diffstat (limited to 'ui/app/components/send/send-content')
4 files changed, 41 insertions, 0 deletions
diff --git a/ui/app/components/send/send-content/send-content.component.js b/ui/app/components/send/send-content/send-content.component.js index adc114c0e..7a0b1a18e 100644 --- a/ui/app/components/send/send-content/send-content.component.js +++ b/ui/app/components/send/send-content/send-content.component.js @@ -4,6 +4,7 @@ import PageContainerContent from '../../page-container/page-container-content.co import SendAmountRow from './send-amount-row/' import SendFromRow from './send-from-row/' import SendGasRow from './send-gas-row/' +import SendHexDataRow from './send-hex-data-row' import SendToRow from './send-to-row/' export default class SendContent extends Component { @@ -20,6 +21,7 @@ export default class SendContent extends Component { <SendToRow updateGas={(updateData) => this.props.updateGas(updateData)} /> <SendAmountRow updateGas={(updateData) => this.props.updateGas(updateData)} /> <SendGasRow /> + <SendHexDataRow /> </div> </PageContainerContent> ) 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 new file mode 100644 index 000000000..4371ef83d --- /dev/null +++ b/ui/app/components/send/send-content/send-hex-data-row/index.js @@ -0,0 +1 @@ +export { default } from './send-hex-data-row.component' 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 new file mode 100644 index 000000000..eaffce359 --- /dev/null +++ b/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.component.js @@ -0,0 +1,38 @@ +import React, { Component } from 'react' +import PropTypes from 'prop-types' +import SendRowWrapper from '../send-row-wrapper' + +export default class SendHexDataRow extends Component { + static propTypes = { + data: PropTypes.string, + inError: PropTypes.bool, + }; + + static contextTypes = { + t: PropTypes.func, + }; + + onInput = (event) => { + event.target.value = event.target.value.replace(/\n/g, '') + } + + render () { + const { + inError, + } = this.props + + return ( + <SendRowWrapper + label={`${this.context.t('hexData')}:`} + showError={inError} + errorType={'amount'} + > + <textarea + onInput={this.onInput} + placeholder="Optional" + className="send-v2__hex-data__input" + /> + </SendRowWrapper> + ) + } +} 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 new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ui/app/components/send/send-content/send-hex-data-row/send-hex-data-row.container.js |