Disable unnecessary curly braces in JSX (#7454)

feature/default_network_editable
Whymarrh Whitby 5 years ago committed by GitHub
parent 659b4360bc
commit f1384e7522
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .eslintrc
  2. 10
      test/unit/ui/app/components/token-cell.spec.js
  3. 2
      ui/app/components/app/account-details/account-details.component.js
  4. 14
      ui/app/components/app/confirm-page-container/confirm-detail-row/tests/confirm-detail-row.component.test.js
  5. 8
      ui/app/components/app/dropdowns/tests/menu.test.js
  6. 6
      ui/app/components/app/dropdowns/tests/network-dropdown-icon.test.js
  7. 8
      ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js
  8. 2
      ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js
  9. 12
      ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js
  10. 2
      ui/app/components/app/modals/confirm-remove-account/confirm-remove-account.component.js
  11. 2
      ui/app/components/app/modals/loading-network-error/loading-network-error.component.js
  12. 6
      ui/app/components/app/modals/metametrics-opt-in-modal/metametrics-opt-in-modal.component.js
  13. 10
      ui/app/components/app/modals/qr-scanner/qr-scanner.component.js
  14. 4
      ui/app/components/app/sidebars/sidebar.component.js
  15. 4
      ui/app/components/app/sidebars/tests/sidebars-component.test.js
  16. 6
      ui/app/components/ui/button-group/tests/button-group-component.test.js
  17. 6
      ui/app/components/ui/page-container/page-container-footer/tests/page-container-footer.component.test.js
  18. 6
      ui/app/components/ui/page-container/page-container-header/tests/page-container-header.component.test.js
  19. 2
      ui/app/pages/confirm-deploy-contract/confirm-deploy-contract.component.js
  20. 2
      ui/app/pages/confirm-send-ether/confirm-send-ether.component.js
  21. 6
      ui/app/pages/first-time-flow/metametrics-opt-in/metametrics-opt-in.component.js
  22. 6
      ui/app/pages/send/account-list-item/tests/account-list-item-component.test.js
  23. 4
      ui/app/pages/send/send-content/add-recipient/tests/add-recipient-component.test.js
  24. 2
      ui/app/pages/send/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
  25. 6
      ui/app/pages/send/send-content/send-amount-row/amount-max-button/tests/amount-max-button-component.test.js
  26. 2
      ui/app/pages/send/send-content/send-amount-row/send-amount-row.component.js
  27. 14
      ui/app/pages/send/send-content/send-amount-row/tests/send-amount-row-component.test.js
  28. 2
      ui/app/pages/send/send-content/send-dropdown-list/send-dropdown-list.component.js
  29. 4
      ui/app/pages/send/send-content/send-dropdown-list/tests/send-dropdown-list-component.test.js
  30. 6
      ui/app/pages/send/send-content/send-gas-row/gas-fee-display/test/gas-fee-display.component.test.js
  31. 2
      ui/app/pages/send/send-content/send-gas-row/send-gas-row.component.js
  32. 6
      ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-component.test.js
  33. 2
      ui/app/pages/send/send-content/send-hex-data-row/send-hex-data-row.component.js
  34. 2
      ui/app/pages/send/send-content/send-row-wrapper/send-row-error-message/tests/send-row-error-message-component.test.js
  35. 12
      ui/app/pages/send/send-content/send-row-wrapper/tests/send-row-wrapper-component.test.js
  36. 28
      ui/app/pages/send/send-footer/tests/send-footer-component.test.js
  37. 2
      ui/app/pages/send/send-header/tests/send-header-component.test.js
  38. 26
      ui/app/pages/send/tests/send-component.test.js
  39. 12
      ui/app/pages/send/to-autocomplete.component.js
  40. 2
      ui/app/pages/settings/contact-list-tab/add-contact/add-contact.component.js
  41. 2
      ui/app/pages/settings/contact-list-tab/edit-contact/edit-contact.component.js

@ -148,6 +148,7 @@
"operator-linebreak": [2, "after", { "overrides": { "?": "ignore", ":": "ignore" } }], "operator-linebreak": [2, "after", { "overrides": { "?": "ignore", ":": "ignore" } }],
"padded-blocks": "off", "padded-blocks": "off",
"quotes": [2, "single", {"avoidEscape": true, "allowTemplateLiterals": true}], "quotes": [2, "single", {"avoidEscape": true, "allowTemplateLiterals": true}],
"react/jsx-curly-brace-presence": [2, { "props": "never", "children": "never" }],
"react/no-deprecated": 0, "react/no-deprecated": 0,
"react/default-props-match-prop-types": 2, "react/default-props-match-prop-types": 2,
"semi": [2, "never"], "semi": [2, "never"],

@ -37,12 +37,12 @@ describe('Token Cell', () => {
wrapper = mount( wrapper = mount(
<Provider store={store}> <Provider store={store}>
<TokenCell <TokenCell
address={'0xAnotherToken'} address="0xAnotherToken"
symbol={'TEST'} symbol="TEST"
string={'5.000'} string="5.000"
network={22} network={22}
currentCurrency={'usd'} currentCurrency="usd"
image={'./test-image'} image="./test-image"
/> />
</Provider> </Provider>
) )

@ -76,7 +76,7 @@ export default class AccountDetails extends Component {
</div> </div>
</div> </div>
<Tooltip <Tooltip
position={'bottom'} position="bottom"
title={hasCopied ? t('copiedExclamation') : t('copyToClipboard')} title={hasCopied ? t('copiedExclamation') : t('copyToClipboard')}
wrapperClassName="account-details__tooltip" wrapperClassName="account-details__tooltip"
> >

@ -14,15 +14,15 @@ describe('Confirm Detail Row Component', function () {
beforeEach(() => { beforeEach(() => {
wrapper = shallow( wrapper = shallow(
<ConfirmDetailRow <ConfirmDetailRow
errorType={'mockErrorType'} errorType="mockErrorType"
label={'mockLabel'} label="mockLabel"
showError={false} showError={false}
primaryText = {'mockFiatText'} primaryText = "mockFiatText"
secondaryText = {'mockEthText'} secondaryText = "mockEthText"
primaryValueTextColor= {'mockColor'} primaryValueTextColor= "mockColor"
onHeaderClick= {propsMethodSpies.onHeaderClick} onHeaderClick= {propsMethodSpies.onHeaderClick}
headerText = {'mockHeaderText'} headerText = "mockHeaderText"
headerTextClassName = {'mockHeaderClass'} headerTextClassName = "mockHeaderClass"
/> />
) )
}) })

@ -11,7 +11,7 @@ describe('Dropdown Menu Components', () => {
beforeEach(() => { beforeEach(() => {
wrapper = shallow( wrapper = shallow(
<Menu className = {'Test Class'} isShowing = {true}/> <Menu className = "Test Class" isShowing = {true}/>
) )
}) })
@ -29,9 +29,9 @@ describe('Dropdown Menu Components', () => {
beforeEach(() => { beforeEach(() => {
wrapper = shallow( wrapper = shallow(
<Item <Item
icon = {'test icon'} icon = "test icon"
text = {'test text'} text = "test text"
className = {'test className'} className = "test className"
onClick = {onClickSpy} onClick = {onClickSpy}
/> />
) )

@ -8,10 +8,10 @@ describe('Network Dropdown Icon', () => {
beforeEach(() => { beforeEach(() => {
wrapper = shallow(<NetworkDropdownIcon wrapper = shallow(<NetworkDropdownIcon
backgroundColor = {'red'} backgroundColor = "red"
isSelected = {false} isSelected = {false}
innerBorder = {'none'} innerBorder = "none"
diameter = {'12'} diameter = "12"
/>) />)
}) })

@ -21,10 +21,10 @@ describe('AdvancedTabContent Component', function () {
wrapper = shallow(<AdvancedTabContent wrapper = shallow(<AdvancedTabContent
updateCustomGasPrice={propsMethodSpies.updateCustomGasPrice} updateCustomGasPrice={propsMethodSpies.updateCustomGasPrice}
updateCustomGasLimit={propsMethodSpies.updateCustomGasLimit} updateCustomGasLimit={propsMethodSpies.updateCustomGasLimit}
customModalGasPriceInHex={'11'} customModalGasPriceInHex="11"
customModalGasLimitInHex={'23456'} customModalGasLimitInHex="23456"
timeRemaining={'21500'} timeRemaining="21500"
transactionFee={'$0.25'} transactionFee="$0.25"
insufficientBalance={false} insufficientBalance={false}
customPriceIsSafe={true} customPriceIsSafe={true}
isSpeedUp={false} isSpeedUp={false}

@ -116,7 +116,7 @@ export default class GasModalPageContainer extends Component {
<span className="gas-modal-content__info-row__send-info__value">{sendAmount}</span> <span className="gas-modal-content__info-row__send-info__value">{sendAmount}</span>
</div> </div>
<div className="gas-modal-content__info-row__transaction-info"> <div className="gas-modal-content__info-row__transaction-info">
<span className={'gas-modal-content__info-row__transaction-info__label'}>{this.context.t('transactionFee')}</span> <span className="gas-modal-content__info-row__transaction-info__label">{this.context.t('transactionFee')}</span>
<span className="gas-modal-content__info-row__transaction-info__value">{transactionFee}</span> <span className="gas-modal-content__info-row__transaction-info__value">{transactionFee}</span>
</div> </div>
<div className="gas-modal-content__info-row__total-info"> <div className="gas-modal-content__info-row__total-info">

@ -74,9 +74,9 @@ describe('GasModalPageContainer Component', function () {
customGasLimit={54321} customGasLimit={54321}
gasPriceButtonGroupProps={mockGasPriceButtonGroupProps} gasPriceButtonGroupProps={mockGasPriceButtonGroupProps}
infoRowProps={mockInfoRowProps} infoRowProps={mockInfoRowProps}
currentTimeEstimate={'1 min 31 sec'} currentTimeEstimate="1 min 31 sec"
customGasPriceInHex={'mockCustomGasPriceInHex'} customGasPriceInHex="mockCustomGasPriceInHex"
customGasLimitInHex={'mockCustomGasLimitInHex'} customGasLimitInHex="mockCustomGasLimitInHex"
insufficientBalance={false} insufficientBalance={false}
disableSave={false} disableSave={false}
/>) />)
@ -195,9 +195,9 @@ describe('GasModalPageContainer Component', function () {
customGasLimit={54321} customGasLimit={54321}
gasPriceButtonGroupProps={mockGasPriceButtonGroupProps} gasPriceButtonGroupProps={mockGasPriceButtonGroupProps}
infoRowProps={mockInfoRowProps} infoRowProps={mockInfoRowProps}
currentTimeEstimate={'1 min 31 sec'} currentTimeEstimate="1 min 31 sec"
customGasPriceInHex={'mockCustomGasPriceInHex'} customGasPriceInHex="mockCustomGasPriceInHex"
customGasLimitInHex={'mockCustomGasLimitInHex'} customGasLimitInHex="mockCustomGasLimitInHex"
insufficientBalance={false} insufficientBalance={false}
disableSave={false} disableSave={false}
hideBasic={true} hideBasic={true}

@ -48,7 +48,7 @@ export default class ConfirmRemoveAccount extends Component {
<a <a
className="" className=""
href={genAccountLink(identity.address, this.props.network)} href={genAccountLink(identity.address, this.props.network)}
target={'_blank'} target="_blank"
title={this.context.t('etherscanView')} title={this.context.t('etherscanView')}
> >
<img src="images/popout.svg" /> <img src="images/popout.svg" />

@ -12,7 +12,7 @@ const LoadingNetworkError = (props, context) => {
submitText={t('tryAgain')} submitText={t('tryAgain')}
> >
<ModalContent <ModalContent
description={'Oops! Something went wrong.'} description="Oops! Something went wrong."
/> />
</Modal> </Modal>
) )

@ -102,7 +102,7 @@ export default class MetaMetricsOptInModal extends Component {
hideModal() hideModal()
}) })
}} }}
cancelText={'No Thanks'} cancelText="No Thanks"
hideCancel={false} hideCancel={false}
onSubmit={() => { onSubmit={() => {
setParticipateInMetaMetrics(true) setParticipateInMetaMetrics(true)
@ -118,8 +118,8 @@ export default class MetaMetricsOptInModal extends Component {
hideModal() hideModal()
}) })
}} }}
submitText={'I agree'} submitText="I agree"
submitButtonType={'confirm'} submitButtonType="confirm"
disabled={false} disabled={false}
/> />
</div> </div>

@ -142,14 +142,14 @@ export default class QrScanner extends Component {
renderVideo () { renderVideo () {
return ( return (
<div className={'qr-scanner__content__video-wrapper'}> <div className="qr-scanner__content__video-wrapper">
<video <video
id="video" id="video"
style={{ style={{
display: this.state.ready ? 'block' : 'none', display: this.state.ready ? 'block' : 'none',
}} }}
/> />
{ !this.state.ready ? <Spinner color={'#F7C06C'} /> : null} { !this.state.ready ? <Spinner color="#F7C06C" /> : null}
</div> </div>
) )
} }
@ -172,12 +172,12 @@ export default class QrScanner extends Component {
<div className="qr-scanner__close" onClick={this.stopAndClose}></div> <div className="qr-scanner__close" onClick={this.stopAndClose}></div>
<div className="qr-scanner__image"> <div className="qr-scanner__image">
<img src={'images/webcam.svg'} width={70} height={70} /> <img src="images/webcam.svg" width={70} height={70} />
</div> </div>
<div className="qr-scanner__title"> <div className="qr-scanner__title">
{ title } { title }
</div> </div>
<div className={'qr-scanner__error'}> <div className="qr-scanner__error">
{msg} {msg}
</div> </div>
<PageContainerFooter <PageContainerFooter
@ -207,7 +207,7 @@ export default class QrScanner extends Component {
<div className="qr-scanner__content"> <div className="qr-scanner__content">
{ this.renderVideo() } { this.renderVideo() }
</div> </div>
<div className={'qr-scanner__status'}> <div className="qr-scanner__status">
{this.state.msg} {this.state.msg}
</div> </div>
</div> </div>

@ -34,9 +34,9 @@ export default class Sidebar extends Component {
const { transaction = {} } = sidebarProps const { transaction = {} } = sidebarProps
switch (type) { switch (type) {
case WALLET_VIEW_SIDEBAR: case WALLET_VIEW_SIDEBAR:
return <WalletView responsiveDisplayClassname={'sidebar-right' } /> return <WalletView responsiveDisplayClassname="sidebar-right" />
case 'customize-gas': case 'customize-gas':
return <div className={'sidebar-left'}><CustomizeGas transaction={transaction} /></div> return <div className="sidebar-left"><CustomizeGas transaction={transaction} /></div>
default: default:
return null return null
} }

@ -19,8 +19,8 @@ describe('Sidebar Component', function () {
wrapper = shallow(<Sidebar wrapper = shallow(<Sidebar
sidebarOpen={false} sidebarOpen={false}
hideSidebar={propsMethodSpies.hideSidebar} hideSidebar={propsMethodSpies.hideSidebar}
transitionName={'someTransition'} transitionName="someTransition"
type={'wallet-view'} type="wallet-view"
/>) />)
}) })

@ -12,9 +12,9 @@ sinon.spy(ButtonGroup.prototype, 'handleButtonClick')
sinon.spy(ButtonGroup.prototype, 'renderButtons') sinon.spy(ButtonGroup.prototype, 'renderButtons')
const mockButtons = [ const mockButtons = [
<button onClick={childButtonSpies.onClick} key={'a'}><div className="mockClass" /></button>, <button onClick={childButtonSpies.onClick} key="a"><div className="mockClass" /></button>,
<button onClick={childButtonSpies.onClick} key={'b'}></button>, <button onClick={childButtonSpies.onClick} key="b"></button>,
<button onClick={childButtonSpies.onClick} key={'c'}></button>, <button onClick={childButtonSpies.onClick} key="c"></button>,
] ]
describe('ButtonGroup Component', function () { describe('ButtonGroup Component', function () {

@ -14,10 +14,10 @@ describe('Page Footer', () => {
wrapper = shallow(<PageFooter wrapper = shallow(<PageFooter
onCancel = {onCancel} onCancel = {onCancel}
onSubmit = {onSubmit} onSubmit = {onSubmit}
cancelText = {'Cancel'} cancelText = "Cancel"
submitText = {'Submit'} submitText = "Submit"
disabled = {false} disabled = {false}
submitButtonType = {'Test Type'} submitButtonType = "Test Type"
/>) />)
}) })

@ -16,9 +16,9 @@ describe('Page Container Header', () => {
showBackButton = {true} showBackButton = {true}
onBackButtonClick = {onBackButtonClick} onBackButtonClick = {onBackButtonClick}
backButtonStyles = {style} backButtonStyles = {style}
title = {'Test Title'} title = "Test Title"
subtitle = {'Test Subtitle'} subtitle = "Test Subtitle"
tabs = {'Test Tab'} tabs = "Test Tab"
onClose = {onClose} onClose = {onClose}
/>) />)
}) })

@ -56,7 +56,7 @@ export default class ConfirmDeployContract extends Component {
render () { render () {
return ( return (
<ConfirmTransactionBase <ConfirmTransactionBase
actionKey={'contractDeployment'} actionKey="contractDeployment"
dataComponent={this.renderData()} dataComponent={this.renderData()}
/> />
) )

@ -30,7 +30,7 @@ export default class ConfirmSendEther extends Component {
return ( return (
<ConfirmTransactionBase <ConfirmTransactionBase
actionKey={'confirm'} actionKey="confirm"
hideData={hideData} hideData={hideData}
onEdit={confirmTransactionData => this.handleEdit(confirmTransactionData)} onEdit={confirmTransactionData => this.handleEdit(confirmTransactionData)}
/> />

@ -104,7 +104,7 @@ export default class MetaMetricsOptIn extends Component {
}) })
}) })
}} }}
cancelText={'No Thanks'} cancelText="No Thanks"
hideCancel={false} hideCancel={false}
onSubmit={() => { onSubmit={() => {
setParticipateInMetaMetrics(true) setParticipateInMetaMetrics(true)
@ -137,8 +137,8 @@ export default class MetaMetricsOptIn extends Component {
}) })
}) })
}} }}
submitText={'I agree'} submitText="I agree"
submitButtonType={'primary'} submitButtonType="primary"
disabled={false} disabled={false}
/> />
<div className="metametrics-opt-in__bottom-text"> <div className="metametrics-opt-in__bottom-text">

@ -25,10 +25,10 @@ describe('AccountListItem Component', function () {
beforeEach(() => { beforeEach(() => {
wrapper = shallow(<AccountListItem wrapper = shallow(<AccountListItem
account={ { address: 'mockAddress', name: 'mockName', balance: 'mockBalance' } } account={ { address: 'mockAddress', name: 'mockName', balance: 'mockBalance' } }
className={'mockClassName'} className="mockClassName"
conversionRate={4} conversionRate={4}
currentCurrency={'mockCurrentyCurrency'} currentCurrency="mockCurrentyCurrency"
nativeCurrency={'ETH'} nativeCurrency="ETH"
displayAddress={false} displayAddress={false}
displayBalance={false} displayBalance={false}
handleClick={propsMethodSpies.handleClick} handleClick={propsMethodSpies.handleClick}

@ -23,9 +23,9 @@ describe('AddRecipient Component', function () {
closeToDropdown={propsMethodSpies.closeToDropdown} closeToDropdown={propsMethodSpies.closeToDropdown}
inError={false} inError={false}
inWarning={false} inWarning={false}
network={'mockNetwork'} network="mockNetwork"
openToDropdown={propsMethodSpies.openToDropdown} openToDropdown={propsMethodSpies.openToDropdown}
to={'mockTo'} to="mockTo"
toAccounts={['mockAccount']} toAccounts={['mockAccount']}
toDropdownOpen={false} toDropdownOpen={false}
updateGas={propsMethodSpies.updateGas} updateGas={propsMethodSpies.updateGas}

@ -64,7 +64,7 @@ export default class AmountMaxButton extends Component {
const { maxModeOn, buttonDataLoading, inError } = this.props const { maxModeOn, buttonDataLoading, inError } = this.props
return ( return (
<div className={'send-v2__amount-max'} onClick={buttonDataLoading || inError ? null : this.onMaxClick}> <div className="send-v2__amount-max" onClick={buttonDataLoading || inError ? null : this.onMaxClick}>
<input type="checkbox" checked={maxModeOn} /> <input type="checkbox" checked={maxModeOn} />
<div className={classnames('send-v2__amount-max__button', { 'send-v2__amount-max__button__disabled': buttonDataLoading || inError })}> <div className={classnames('send-v2__amount-max__button', { 'send-v2__amount-max__button__disabled': buttonDataLoading || inError })}>
{this.context.t('max')} {this.context.t('max')}

@ -19,13 +19,13 @@ describe('AmountMaxButton Component', function () {
beforeEach(() => { beforeEach(() => {
wrapper = shallow(<AmountMaxButton wrapper = shallow(<AmountMaxButton
balance={'mockBalance'} balance="mockBalance"
gasTotal={'mockGasTotal'} gasTotal="mockGasTotal"
maxModeOn={false} maxModeOn={false}
selectedToken={ { address: 'mockTokenAddress' } } selectedToken={ { address: 'mockTokenAddress' } }
setAmountToMax={propsMethodSpies.setAmountToMax} setAmountToMax={propsMethodSpies.setAmountToMax}
setMaxModeTo={propsMethodSpies.setMaxModeTo} setMaxModeTo={propsMethodSpies.setMaxModeTo}
tokenBalance={'mockTokenBalance'} tokenBalance="mockTokenBalance"
/>, { />, {
context: { context: {
t: str => str + '_t', t: str => str + '_t',

@ -108,7 +108,7 @@ export default class SendAmountRow extends Component {
<SendRowWrapper <SendRowWrapper
label={`${this.context.t('amount')}:`} label={`${this.context.t('amount')}:`}
showError={inError} showError={inError}
errorType={'amount'} errorType="amount"
> >
{gasTotal && <AmountMaxButton inError={inError} />} {gasTotal && <AmountMaxButton inError={inError} />}
{ this.renderInput() } { this.renderInput() }

@ -26,17 +26,17 @@ describe('SendAmountRow Component', function () {
beforeEach(() => { beforeEach(() => {
wrapper = shallow(<SendAmountRow wrapper = shallow(<SendAmountRow
amount={'mockAmount'} amount="mockAmount"
amountConversionRate={'mockAmountConversionRate'} amountConversionRate="mockAmountConversionRate"
balance={'mockBalance'} balance="mockBalance"
conversionRate={7} conversionRate={7}
convertedCurrency={'mockConvertedCurrency'} convertedCurrency="mockConvertedCurrency"
gasTotal={'mockGasTotal'} gasTotal="mockGasTotal"
inError={false} inError={false}
primaryCurrency={'mockPrimaryCurrency'} primaryCurrency="mockPrimaryCurrency"
selectedToken={ { address: 'mockTokenAddress' } } selectedToken={ { address: 'mockTokenAddress' } }
setMaxModeTo={propsMethodSpies.setMaxModeTo} setMaxModeTo={propsMethodSpies.setMaxModeTo}
tokenBalance={'mockTokenBalance'} tokenBalance="mockTokenBalance"
updateGasFeeError={propsMethodSpies.updateGasFeeError} updateGasFeeError={propsMethodSpies.updateGasFeeError}
updateSendAmount={propsMethodSpies.updateSendAmount} updateSendAmount={propsMethodSpies.updateSendAmount}
updateSendAmountError={propsMethodSpies.updateSendAmountError} updateSendAmountError={propsMethodSpies.updateSendAmountError}

@ -17,7 +17,7 @@ export default class SendDropdownList extends Component {
getListItemIcon (accountAddress, activeAddress) { getListItemIcon (accountAddress, activeAddress) {
return accountAddress === activeAddress return accountAddress === activeAddress
? <i className={`fa fa-check fa-lg`} style={ { color: '#02c9b1' } }/> ? <i className="fa fa-check fa-lg" style={ { color: '#02c9b1' } }/>
: null : null
} }

@ -25,7 +25,7 @@ describe('SendDropdownList Component', function () {
]} ]}
closeDropdown={propsMethodSpies.closeDropdown} closeDropdown={propsMethodSpies.closeDropdown}
onSelect={propsMethodSpies.onSelect} onSelect={propsMethodSpies.onSelect}
activeAddress={'mockAddress2'} activeAddress="mockAddress2"
/>, { context: { t: str => str + '_t' } }) />, { context: { t: str => str + '_t' } })
}) })
@ -39,7 +39,7 @@ describe('SendDropdownList Component', function () {
it('should return check icon if the passed addresses are the same', () => { it('should return check icon if the passed addresses are the same', () => {
assert.deepEqual( assert.deepEqual(
wrapper.instance().getListItemIcon('mockAccount0', 'mockAccount0'), wrapper.instance().getListItemIcon('mockAccount0', 'mockAccount0'),
<i className={`fa fa-check fa-lg`} style={ { color: '#02c9b1' } }/> <i className="fa fa-check fa-lg" style={ { color: '#02c9b1' } }/>
) )
}) })

@ -17,9 +17,9 @@ describe('GasFeeDisplay Component', function () {
beforeEach(() => { beforeEach(() => {
wrapper = shallow(<GasFeeDisplay wrapper = shallow(<GasFeeDisplay
conversionRate={20} conversionRate={20}
gasTotal={'mockGasTotal'} gasTotal="mockGasTotal"
primaryCurrency={'mockPrimaryCurrency'} primaryCurrency="mockPrimaryCurrency"
convertedCurrency={'mockConvertedCurrency'} convertedCurrency="mockConvertedCurrency"
showGasButtonGroup={propsMethodSpies.showCustomizeGasModal} showGasButtonGroup={propsMethodSpies.showCustomizeGasModal}
onReset={propsMethodSpies.onReset} onReset={propsMethodSpies.onReset}
/>, {context: {t: str => str + '_t'}}) />, {context: {t: str => str + '_t'}})

@ -152,7 +152,7 @@ export default class SendGasRow extends Component {
<SendRowWrapper <SendRowWrapper
label={`${this.context.t('transactionFee')}:`} label={`${this.context.t('transactionFee')}:`}
showError={gasFeeError} showError={gasFeeError}
errorType={'gasFee'} errorType="gasFee"
> >
{ this.renderContent() } { this.renderContent() }
</SendRowWrapper> </SendRowWrapper>

@ -19,10 +19,10 @@ describe('SendGasRow Component', function () {
beforeEach(() => { beforeEach(() => {
wrapper = shallow(<SendGasRow wrapper = shallow(<SendGasRow
conversionRate={20} conversionRate={20}
convertedCurrency={'mockConvertedCurrency'} convertedCurrency="mockConvertedCurrency"
gasFeeError={'mockGasFeeError'} gasFeeError="mockGasFeeError"
gasLoadingError={false} gasLoadingError={false}
gasTotal={'mockGasTotal'} gasTotal="mockGasTotal"
gasButtonGroupShown={false} gasButtonGroupShown={false}
showCustomizeGasModal={propsMethodSpies.showCustomizeGasModal} showCustomizeGasModal={propsMethodSpies.showCustomizeGasModal}
resetGasButtons={propsMethodSpies.resetGasButtons} resetGasButtons={propsMethodSpies.resetGasButtons}

@ -29,7 +29,7 @@ export default class SendHexDataRow extends Component {
<SendRowWrapper <SendRowWrapper
label={`${t('hexData')}:`} label={`${t('hexData')}:`}
showError={inError} showError={inError}
errorType={'amount'} errorType="amount"
> >
<textarea <textarea
onInput={this.onInput} onInput={this.onInput}

@ -9,7 +9,7 @@ describe('SendRowErrorMessage Component', function () {
beforeEach(() => { beforeEach(() => {
wrapper = shallow(<SendRowErrorMessage wrapper = shallow(<SendRowErrorMessage
errors={{ error1: 'abc', error2: 'def' }} errors={{ error1: 'abc', error2: 'def' }}
errorType={'error3'} errorType="error3"
/>, { context: { t: str => str + '_t' } }) />, { context: { t: str => str + '_t' } })
}) })

@ -10,8 +10,8 @@ describe('SendContent Component', function () {
beforeEach(() => { beforeEach(() => {
wrapper = shallow(<SendRowWrapper wrapper = shallow(<SendRowWrapper
errorType={'mockErrorType'} errorType="mockErrorType"
label={'mockLabel'} label="mockLabel"
showError={false} showError={false}
> >
<span>Mock Form Field</span> <span>Mock Form Field</span>
@ -54,8 +54,8 @@ describe('SendContent Component', function () {
it('should render its second child as a child of the send-v2__form-field, if it has two children', () => { it('should render its second child as a child of the send-v2__form-field, if it has two children', () => {
wrapper = shallow(<SendRowWrapper wrapper = shallow(<SendRowWrapper
errorType={'mockErrorType'} errorType="mockErrorType"
label={'mockLabel'} label="mockLabel"
showError={false} showError={false}
> >
<span>Mock Custom Label Content</span> <span>Mock Custom Label Content</span>
@ -66,8 +66,8 @@ describe('SendContent Component', function () {
it('should render its first child as the last child of the send-v2__form-label, if it has two children', () => { it('should render its first child as the last child of the send-v2__form-label, if it has two children', () => {
wrapper = shallow(<SendRowWrapper wrapper = shallow(<SendRowWrapper
errorType={'mockErrorType'} errorType="mockErrorType"
label={'mockLabel'} label="mockLabel"
showError={false} showError={false}
> >
<span>Mock Custom Label Content</span> <span>Mock Custom Label Content</span>

@ -27,22 +27,22 @@ describe('SendFooter Component', function () {
beforeEach(() => { beforeEach(() => {
wrapper = shallow(<SendFooter wrapper = shallow(<SendFooter
addToAddressBookIfNew={propsMethodSpies.addToAddressBookIfNew} addToAddressBookIfNew={propsMethodSpies.addToAddressBookIfNew}
amount={'mockAmount'} amount="mockAmount"
clearSend={propsMethodSpies.clearSend} clearSend={propsMethodSpies.clearSend}
disabled={true} disabled={true}
editingTransactionId={'mockEditingTransactionId'} editingTransactionId="mockEditingTransactionId"
errors={{}} errors={{}}
from={ { address: 'mockAddress', balance: 'mockBalance' } } from={ { address: 'mockAddress', balance: 'mockBalance' } }
gasLimit={'mockGasLimit'} gasLimit="mockGasLimit"
gasPrice={'mockGasPrice'} gasPrice="mockGasPrice"
gasTotal={'mockGasTotal'} gasTotal="mockGasTotal"
history={historySpies} history={historySpies}
inError={false} inError={false}
selectedToken={{ mockProp: 'mockSelectedTokenProp' }} selectedToken={{ mockProp: 'mockSelectedTokenProp' }}
sign={propsMethodSpies.sign} sign={propsMethodSpies.sign}
to={'mockTo'} to="mockTo"
toAccounts={['mockAccount']} toAccounts={['mockAccount']}
tokenBalance={'mockTokenBalance'} tokenBalance="mockTokenBalance"
unapprovedTxs={['mockTx']} unapprovedTxs={['mockTx']}
update={propsMethodSpies.update} update={propsMethodSpies.update}
sendErrors={{}} sendErrors={{}}
@ -184,22 +184,22 @@ describe('SendFooter Component', function () {
sinon.stub(SendFooter.prototype, 'formShouldBeDisabled').returns('formShouldBeDisabledReturn') sinon.stub(SendFooter.prototype, 'formShouldBeDisabled').returns('formShouldBeDisabledReturn')
wrapper = shallow(<SendFooter wrapper = shallow(<SendFooter
addToAddressBookIfNew={propsMethodSpies.addToAddressBookIfNew} addToAddressBookIfNew={propsMethodSpies.addToAddressBookIfNew}
amount={'mockAmount'} amount="mockAmount"
clearSend={propsMethodSpies.clearSend} clearSend={propsMethodSpies.clearSend}
disabled={true} disabled={true}
editingTransactionId={'mockEditingTransactionId'} editingTransactionId="mockEditingTransactionId"
errors={{}} errors={{}}
from={ { address: 'mockAddress', balance: 'mockBalance' } } from={ { address: 'mockAddress', balance: 'mockBalance' } }
gasLimit={'mockGasLimit'} gasLimit="mockGasLimit"
gasPrice={'mockGasPrice'} gasPrice="mockGasPrice"
gasTotal={'mockGasTotal'} gasTotal="mockGasTotal"
history={historySpies} history={historySpies}
inError={false} inError={false}
selectedToken={{ mockProp: 'mockSelectedTokenProp' }} selectedToken={{ mockProp: 'mockSelectedTokenProp' }}
sign={propsMethodSpies.sign} sign={propsMethodSpies.sign}
to={'mockTo'} to="mockTo"
toAccounts={['mockAccount']} toAccounts={['mockAccount']}
tokenBalance={'mockTokenBalance'} tokenBalance="mockTokenBalance"
unapprovedTxs={['mockTx']} unapprovedTxs={['mockTx']}
update={propsMethodSpies.update} update={propsMethodSpies.update}
/>, { context: { t: str => str, metricsEvent: () => ({}) } }) />, { context: { t: str => str, metricsEvent: () => ({}) } })

@ -23,7 +23,7 @@ describe('SendHeader Component', function () {
wrapper = shallow(<SendHeader wrapper = shallow(<SendHeader
clearSend={propsMethodSpies.clearSend} clearSend={propsMethodSpies.clearSend}
history={historySpies} history={historySpies}
titleKey={'mockTitleKey'} titleKey="mockTitleKey"
/>, { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } }) />, { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } })
}) })

@ -41,26 +41,26 @@ describe('Send Component', function () {
beforeEach(() => { beforeEach(() => {
wrapper = shallow(<SendTransactionScreen wrapper = shallow(<SendTransactionScreen
amount={'mockAmount'} amount="mockAmount"
amountConversionRate={'mockAmountConversionRate'} amountConversionRate="mockAmountConversionRate"
blockGasLimit={'mockBlockGasLimit'} blockGasLimit="mockBlockGasLimit"
conversionRate={10} conversionRate={10}
editingTransactionId={'mockEditingTransactionId'} editingTransactionId="mockEditingTransactionId"
fetchBasicGasEstimates={propsMethodSpies.fetchBasicGasEstimates} fetchBasicGasEstimates={propsMethodSpies.fetchBasicGasEstimates}
fetchGasEstimates={propsMethodSpies.fetchGasEstimates} fetchGasEstimates={propsMethodSpies.fetchGasEstimates}
from={ { address: 'mockAddress', balance: 'mockBalance' } } from={ { address: 'mockAddress', balance: 'mockBalance' } }
gasLimit={'mockGasLimit'} gasLimit="mockGasLimit"
gasPrice={'mockGasPrice'} gasPrice="mockGasPrice"
gasTotal={'mockGasTotal'} gasTotal="mockGasTotal"
history={{ mockProp: 'history-abc'}} history={{ mockProp: 'history-abc'}}
network={'3'} network="3"
primaryCurrency={'mockPrimaryCurrency'} primaryCurrency="mockPrimaryCurrency"
recentBlocks={['mockBlock']} recentBlocks={['mockBlock']}
selectedAddress={'mockSelectedAddress'} selectedAddress="mockSelectedAddress"
selectedToken={'mockSelectedToken'} selectedToken="mockSelectedToken"
showHexData={true} showHexData={true}
tokenBalance={'mockTokenBalance'} tokenBalance="mockTokenBalance"
tokenContract={'mockTokenContract'} tokenContract="mockTokenContract"
updateAndSetGasLimit={propsMethodSpies.updateAndSetGasLimit} updateAndSetGasLimit={propsMethodSpies.updateAndSetGasLimit}
updateSendErrors={propsMethodSpies.updateSendErrors} updateSendErrors={propsMethodSpies.updateSendErrors}
updateSendTokenBalance={propsMethodSpies.updateSendTokenBalance} updateSendTokenBalance={propsMethodSpies.updateSendTokenBalance}

@ -26,7 +26,7 @@ export default class ToAutoComplete extends Component {
getListItemIcon (listItemAddress, toAddress) { getListItemIcon (listItemAddress, toAddress) {
return toAddress && listItemAddress === toAddress return toAddress && listItemAddress === toAddress
? <i className={'fa fa-check fa-lg'} ? <i className="fa fa-check fa-lg"
style={{ style={{
color: '#02c9b1', color: '#02c9b1',
}} }}
@ -48,13 +48,13 @@ export default class ToAutoComplete extends Component {
return ( return (
<div> <div>
<div className={'send-v2__from-dropdown__close-area'} onClick={closeDropdown} /> <div className="send-v2__from-dropdown__close-area" onClick={closeDropdown} />
<div className={'send-v2__from-dropdown__list'}> <div className="send-v2__from-dropdown__list">
{accountsToRender.map((account, i) => ( {accountsToRender.map((account, i) => (
<AccountListItem <AccountListItem
key={i} key={i}
account={account} account={account}
className={'account-list-item__dropdown'} className="account-list-item__dropdown"
handleClick={() => { handleClick={() => {
onChange(account.address) onChange(account.address)
closeDropdown() closeDropdown()
@ -106,7 +106,7 @@ export default class ToAutoComplete extends Component {
} = this.props } = this.props
return ( return (
<div className={'send-v2__to-autocomplete'}> <div className="send-v2__to-autocomplete">
<input <input
className={classnames('send-v2__to-autocomplete__input', { className={classnames('send-v2__to-autocomplete__input', {
'send-v2__error-border': inError, 'send-v2__error-border': inError,
@ -122,7 +122,7 @@ export default class ToAutoComplete extends Component {
{ {
to to
? null ? null
: <i className={'fa fa-caret-down fa-lg send-v2__to-autocomplete__down-caret'} : <i className="fa fa-caret-down fa-lg send-v2__to-autocomplete__down-caret"
onClick={() => this.handleInputEvent()} onClick={() => this.handleInputEvent()}
style={{ style={{
style: {color: '#dedede'}, style: {color: '#dedede'},

@ -123,7 +123,7 @@ export default class AddContact extends PureComponent {
history.push(CONTACT_LIST_ROUTE) history.push(CONTACT_LIST_ROUTE)
}} }}
submitText={this.context.t('save')} submitText={this.context.t('save')}
submitButtonType={'confirm'} submitButtonType="confirm"
/> />
</div> </div>
) )

@ -133,7 +133,7 @@ export default class EditContact extends PureComponent {
history.push(`${viewRoute}/${address}`) history.push(`${viewRoute}/${address}`)
}} }}
submitText={this.context.t('save')} submitText={this.context.t('save')}
submitButtonType={'confirm'} submitButtonType="confirm"
/> />
</div> </div>
) )

Loading…
Cancel
Save