1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Add hex data row to send screen

This commit is contained in:
Whymarrh Whitby 2018-07-16 18:21:02 -02:30
parent f6ca06f775
commit 3f9c3d76b6
5 changed files with 43 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import PageContainerContent from '../../page-container/page-container-content.co
import SendAmountRow from './send-amount-row/' import SendAmountRow from './send-amount-row/'
import SendFromRow from './send-from-row/' import SendFromRow from './send-from-row/'
import SendGasRow from './send-gas-row/' import SendGasRow from './send-gas-row/'
import SendHexDataRow from './send-hex-data-row'
import SendToRow from './send-to-row/' import SendToRow from './send-to-row/'
export default class SendContent extends Component { export default class SendContent extends Component {
@ -20,6 +21,7 @@ export default class SendContent extends Component {
<SendToRow updateGas={(updateData) => this.props.updateGas(updateData)} /> <SendToRow updateGas={(updateData) => this.props.updateGas(updateData)} />
<SendAmountRow updateGas={(updateData) => this.props.updateGas(updateData)} /> <SendAmountRow updateGas={(updateData) => this.props.updateGas(updateData)} />
<SendGasRow /> <SendGasRow />
<SendHexDataRow />
</div> </div>
</PageContainerContent> </PageContainerContent>
) )

View File

@ -0,0 +1 @@
export { default } from './send-hex-data-row.component'

View File

@ -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>
)
}
}

View File

@ -628,7 +628,7 @@
} }
} }
&__to-autocomplete, &__memo-text-area { &__to-autocomplete, &__memo-text-area, &__hex-data {
&__input { &__input {
height: 54px; height: 54px;
width: 100%; width: 100%;
@ -899,4 +899,4 @@
.sliders-icon { .sliders-icon {
color: $curious-blue; color: $curious-blue;
} }