Merge pull request #4702 from BitGuildPlatform/contextTypes

convert contextType to static prop for refactored components
feature/default_network_editable
Dan J Miller 6 years ago committed by GitHub
commit 4d105d9cca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      ui/app/components/send_/account-list-item/account-list-item.component.js
  2. 8
      ui/app/components/send_/send-content/send-amount-row/amount-max-button/amount-max-button.component.js
  3. 11
      ui/app/components/send_/send-content/send-amount-row/send-amount-row.component.js
  4. 8
      ui/app/components/send_/send-content/send-dropdown-list/send-dropdown-list.component.js
  5. 8
      ui/app/components/send_/send-content/send-from-row/from-dropdown/from-dropdown.component.js
  6. 8
      ui/app/components/send_/send-content/send-from-row/send-from-row.component.js
  7. 8
      ui/app/components/send_/send-content/send-gas-row/gas-fee-display/gas-fee-display.component.js
  8. 8
      ui/app/components/send_/send-content/send-gas-row/send-gas-row.component.js
  9. 8
      ui/app/components/send_/send-content/send-row-wrapper/send-row-error-message/send-row-error-message.component.js
  10. 8
      ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js
  11. 9
      ui/app/components/send_/send-content/send-to-row/send-to-row.component.js
  12. 8
      ui/app/components/send_/send-footer/send-footer.component.js
  13. 8
      ui/app/components/send_/send-header/send-header.component.js
  14. 8
      ui/app/components/send_/send.component.js

@ -17,6 +17,10 @@ export default class AccountListItem extends Component {
icon: PropTypes.node, icon: PropTypes.node,
}; };
static contextTypes = {
t: PropTypes.func,
};
render () { render () {
const { const {
account, account,
@ -67,8 +71,3 @@ export default class AccountListItem extends Component {
</div>) </div>)
} }
} }
AccountListItem.contextTypes = {
t: PropTypes.func,
}

@ -13,6 +13,10 @@ export default class AmountMaxButton extends Component {
tokenBalance: PropTypes.string, tokenBalance: PropTypes.string,
}; };
static contextTypes = {
t: PropTypes.func,
};
setMaxAmount () { setMaxAmount () {
const { const {
balance, balance,
@ -48,7 +52,3 @@ export default class AmountMaxButton extends Component {
} }
} }
AmountMaxButton.contextTypes = {
t: PropTypes.func,
}

@ -25,7 +25,11 @@ export default class SendAmountRow extends Component {
updateSendAmount: PropTypes.func, updateSendAmount: PropTypes.func,
updateSendAmountError: PropTypes.func, updateSendAmountError: PropTypes.func,
updateGas: PropTypes.func, updateGas: PropTypes.func,
} };
static contextTypes = {
t: PropTypes.func,
};
validateAmount (amount) { validateAmount (amount) {
const { const {
@ -117,8 +121,3 @@ export default class SendAmountRow extends Component {
} }
} }
SendAmountRow.contextTypes = {
t: PropTypes.func,
}

@ -11,6 +11,10 @@ export default class SendDropdownList extends Component {
activeAddress: PropTypes.string, activeAddress: PropTypes.string,
}; };
static contextTypes = {
t: PropTypes.func,
};
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' } }/>
@ -46,7 +50,3 @@ export default class SendDropdownList extends Component {
} }
} }
SendDropdownList.contextTypes = {
t: PropTypes.func,
}

@ -14,6 +14,10 @@ export default class FromDropdown extends Component {
selectedAccount: PropTypes.object, selectedAccount: PropTypes.object,
}; };
static contextTypes = {
t: PropTypes.func,
};
render () { render () {
const { const {
accounts, accounts,
@ -40,7 +44,3 @@ export default class FromDropdown extends Component {
} }
} }
FromDropdown.contextTypes = {
t: PropTypes.func,
}

@ -17,6 +17,10 @@ export default class SendFromRow extends Component {
setSendTokenBalance: PropTypes.func, setSendTokenBalance: PropTypes.func,
}; };
static contextTypes = {
t: PropTypes.func,
};
async handleFromChange (newFrom) { async handleFromChange (newFrom) {
const { const {
updateSendFrom, updateSendFrom,
@ -57,7 +61,3 @@ export default class SendFromRow extends Component {
} }
} }
SendFromRow.contextTypes = {
t: PropTypes.func,
}

@ -14,6 +14,10 @@ export default class GasFeeDisplay extends Component {
onClick: PropTypes.func, onClick: PropTypes.func,
}; };
static contextTypes = {
t: PropTypes.func,
};
render () { render () {
const { const {
conversionRate, conversionRate,
@ -55,7 +59,3 @@ export default class GasFeeDisplay extends Component {
) )
} }
} }
GasFeeDisplay.contextTypes = {
t: PropTypes.func,
}

@ -14,6 +14,10 @@ export default class SendGasRow extends Component {
showCustomizeGasModal: PropTypes.func, showCustomizeGasModal: PropTypes.func,
}; };
static contextTypes = {
t: PropTypes.func,
};
render () { render () {
const { const {
conversionRate, conversionRate,
@ -42,7 +46,3 @@ export default class SendGasRow extends Component {
} }
} }
SendGasRow.contextTypes = {
t: PropTypes.func,
}

@ -8,6 +8,10 @@ export default class SendRowErrorMessage extends Component {
errorType: PropTypes.string, errorType: PropTypes.string,
}; };
static contextTypes = {
t: PropTypes.func,
};
render () { render () {
const { errors, errorType } = this.props const { errors, errorType } = this.props
@ -21,7 +25,3 @@ export default class SendRowErrorMessage extends Component {
} }
} }
SendRowErrorMessage.contextTypes = {
t: PropTypes.func,
}

@ -11,6 +11,10 @@ export default class SendRowWrapper extends Component {
showError: PropTypes.bool, showError: PropTypes.bool,
}; };
static contextTypes = {
t: PropTypes.func,
};
render () { render () {
const { const {
children, children,
@ -37,7 +41,3 @@ export default class SendRowWrapper extends Component {
} }
} }
SendRowWrapper.contextTypes = {
t: PropTypes.func,
}

@ -19,6 +19,10 @@ export default class SendToRow extends Component {
updateSendToError: PropTypes.func, updateSendToError: PropTypes.func,
}; };
static contextTypes = {
t: PropTypes.func,
};
handleToChange (to, nickname = '', toError) { handleToChange (to, nickname = '', toError) {
const { updateSendTo, updateSendToError, updateGas } = this.props const { updateSendTo, updateSendToError, updateGas } = this.props
const toErrorObject = getToErrorObject(to, toError) const toErrorObject = getToErrorObject(to, toError)
@ -63,8 +67,3 @@ export default class SendToRow extends Component {
} }
} }
SendToRow.contextTypes = {
t: PropTypes.func,
}

@ -27,6 +27,10 @@ export default class SendFooter extends Component {
update: PropTypes.func, update: PropTypes.func,
}; };
static contextTypes = {
t: PropTypes.func,
};
onCancel () { onCancel () {
this.props.clearSend() this.props.clearSend()
this.props.history.push(DEFAULT_ROUTE) this.props.history.push(DEFAULT_ROUTE)
@ -95,7 +99,3 @@ export default class SendFooter extends Component {
} }
} }
SendFooter.contextTypes = {
t: PropTypes.func,
}

@ -12,6 +12,10 @@ export default class SendHeader extends Component {
subtitleParams: PropTypes.array, subtitleParams: PropTypes.array,
}; };
static contextTypes = {
t: PropTypes.func,
};
onClose () { onClose () {
this.props.clearSend() this.props.clearSend()
this.props.history.push(DEFAULT_ROUTE) this.props.history.push(DEFAULT_ROUTE)
@ -28,7 +32,3 @@ export default class SendHeader extends Component {
} }
} }
SendHeader.contextTypes = {
t: PropTypes.func,
}

@ -40,6 +40,10 @@ export default class SendTransactionScreen extends PersistentForm {
updateSendTokenBalance: PropTypes.func, updateSendTokenBalance: PropTypes.func,
}; };
static contextTypes = {
t: PropTypes.func,
};
updateGas ({ to: updatedToAddress, amount: value } = {}) { updateGas ({ to: updatedToAddress, amount: value } = {}) {
const { const {
amount, amount,
@ -173,7 +177,3 @@ export default class SendTransactionScreen extends PersistentForm {
} }
} }
SendTransactionScreen.contextTypes = {
t: PropTypes.func,
}

Loading…
Cancel
Save