Add missing PropTypes (#7658)

The props for `send` were also sorted, to make them easier to compare.
I only bothered because they were _almost_ sorted already.
feature/default_network_editable
Mark Stacey 5 years ago committed by GitHub
parent b34c663712
commit e87e79870a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      ui/app/components/ui/currency-display/currency-display.container.js
  2. 3
      ui/app/pages/first-time-flow/seed-phrase/confirm-seed-phrase/confirm-seed-phrase.component.js
  3. 20
      ui/app/pages/send/send.component.js
  4. 8
      ui/app/pages/send/send.container.js

@ -1,6 +1,8 @@
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import CurrencyDisplay from './currency-display.component'
import { getValueFromWeiHex, formatCurrency } from '../../../helpers/utils/confirm-tx.util'
import { GWEI } from '../../../helpers/constants/common'
const mapStateToProps = state => {
const { metamask: { nativeCurrency, currentCurrency, conversionRate } } = state
@ -48,4 +50,21 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
}
}
export default connect(mapStateToProps, null, mergeProps)(CurrencyDisplay)
const CurrencyDisplayContainer = connect(mapStateToProps, null, mergeProps)(CurrencyDisplay)
CurrencyDisplayContainer.propTypes = {
className: PropTypes.string,
currency: PropTypes.string,
denomination: PropTypes.oneOf([GWEI]),
displayValue: PropTypes.string,
hideLabel: PropTypes.bool,
hideTitle: PropTypes.bool,
numberOfDecimals: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
prefix: PropTypes.string,
prefixComponent: PropTypes.node,
style: PropTypes.object,
suffix: PropTypes.string,
value: PropTypes.string,
}
export default CurrencyDisplayContainer

@ -24,11 +24,14 @@ export default class ConfirmSeedPhrase extends PureComponent {
}
static propTypes = {
hideSeedPhraseBackupAfterOnboarding: PropTypes.func,
history: PropTypes.object,
onSubmit: PropTypes.func,
seedPhrase: PropTypes.string,
selectedAddress: PropTypes.string,
initializeThreeBox: PropTypes.func,
setSeedPhraseBackedUp: PropTypes.func,
showingSeedPhraseBackupAfterOnboarding: PropTypes.bool,
}
state = {

@ -27,26 +27,34 @@ export default class SendTransactionScreen extends PersistentForm {
blockGasLimit: PropTypes.string,
conversionRate: PropTypes.number,
editingTransactionId: PropTypes.string,
fetchBasicGasEstimates: PropTypes.func.isRequired,
from: PropTypes.object,
gasLimit: PropTypes.string,
gasPrice: PropTypes.string,
gasTotal: PropTypes.string,
to: PropTypes.string,
history: PropTypes.object,
network: PropTypes.string,
primaryCurrency: PropTypes.string,
recentBlocks: PropTypes.array,
resetSendState: PropTypes.func.isRequired,
selectedAddress: PropTypes.string,
selectedToken: PropTypes.object,
showHexData: PropTypes.bool,
to: PropTypes.string,
toNickname: PropTypes.string,
tokens: PropTypes.array,
tokenBalance: PropTypes.string,
tokenContract: PropTypes.object,
fetchBasicGasEstimates: PropTypes.func,
updateAndSetGasTotal: PropTypes.func,
updateSendErrors: PropTypes.func,
updateSendTokenBalance: PropTypes.func,
scanQrCode: PropTypes.func,
qrCodeDetected: PropTypes.func,
updateAndSetGasLimit: PropTypes.func.isRequired,
updateSendEnsResolution: PropTypes.func.isRequired,
updateSendEnsResolutionError: PropTypes.func.isRequired,
updateSendErrors: PropTypes.func.isRequired,
updateSendTo: PropTypes.func.isRequired,
updateSendTokenBalance: PropTypes.func.isRequired,
updateToNicknameIfNecessary: PropTypes.func.isRequired,
scanQrCode: PropTypes.func.isRequired,
qrCodeDetected: PropTypes.func.isRequired,
qrCodeData: PropTypes.object,
ensResolution: PropTypes.string,
ensResolutionError: PropTypes.string,

@ -64,31 +64,31 @@ import {
function mapStateToProps (state) {
return {
addressBook: getAddressBook(state),
amount: getSendAmount(state),
amountConversionRate: getAmountConversionRate(state),
blockGasLimit: getBlockGasLimit(state),
conversionRate: getConversionRate(state),
editingTransactionId: getSendEditingTransactionId(state),
ensResolution: getSendEnsResolution(state),
ensResolutionError: getSendEnsResolutionError(state),
from: getSendFromObject(state),
gasLimit: getGasLimit(state),
gasPrice: getGasPrice(state),
gasTotal: getGasTotal(state),
network: getCurrentNetwork(state),
primaryCurrency: getPrimaryCurrency(state),
qrCodeData: getQrCodeData(state),
recentBlocks: getRecentBlocks(state),
selectedAddress: getSelectedAddress(state),
selectedToken: getSelectedToken(state),
showHexData: getSendHexDataFeatureFlagState(state),
ensResolution: getSendEnsResolution(state),
ensResolutionError: getSendEnsResolutionError(state),
to: getSendTo(state),
toNickname: getSendToNickname(state),
tokens: getTokens(state),
tokenBalance: getTokenBalance(state),
tokenContract: getSelectedTokenContract(state),
tokenToFiatRate: getSelectedTokenToFiatRate(state),
qrCodeData: getQrCodeData(state),
addressBook: getAddressBook(state),
}
}

Loading…
Cancel
Save