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

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.
This commit is contained in:
Mark Stacey 2019-12-06 11:32:03 -04:00 committed by GitHub
parent b34c663712
commit e87e79870a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 11 deletions

View File

@ -1,6 +1,8 @@
import { connect } from 'react-redux' import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import CurrencyDisplay from './currency-display.component' import CurrencyDisplay from './currency-display.component'
import { getValueFromWeiHex, formatCurrency } from '../../../helpers/utils/confirm-tx.util' import { getValueFromWeiHex, formatCurrency } from '../../../helpers/utils/confirm-tx.util'
import { GWEI } from '../../../helpers/constants/common'
const mapStateToProps = state => { const mapStateToProps = state => {
const { metamask: { nativeCurrency, currentCurrency, conversionRate } } = 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

View File

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

View File

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

View File

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