mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove useless component constructors (#7718)
This commit is contained in:
parent
4f79b924e4
commit
8701ac38a1
@ -12,12 +12,8 @@ export default class InfoBox extends Component {
|
|||||||
description: PropTypes.string,
|
description: PropTypes.string,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor (props) {
|
state = {
|
||||||
super(props)
|
isShowing: true,
|
||||||
|
|
||||||
this.state = {
|
|
||||||
isShowing: true,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleClose () {
|
handleClose () {
|
||||||
|
@ -2,17 +2,17 @@ import React, { Component } from 'react'
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
export default class Tabs extends Component {
|
export default class Tabs extends Component {
|
||||||
|
static defaultProps = {
|
||||||
|
defaultActiveTabIndex: 0,
|
||||||
|
}
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
defaultActiveTabIndex: PropTypes.number,
|
defaultActiveTabIndex: PropTypes.number,
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor (props) {
|
state = {
|
||||||
super(props)
|
activeTabIndex: this.props.defaultActiveTabIndex,
|
||||||
|
|
||||||
this.state = {
|
|
||||||
activeTabIndex: props.defaultActiveTabIndex || 0,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleTabClick (tabIndex) {
|
handleTabClick (tabIndex) {
|
||||||
|
@ -22,15 +22,12 @@ export default class UnitInput extends PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
|
value: '',
|
||||||
placeholder: '0',
|
placeholder: '0',
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor (props) {
|
state = {
|
||||||
super(props)
|
value: this.props.value,
|
||||||
|
|
||||||
this.state = {
|
|
||||||
value: props.value || '',
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate (prevProps) {
|
componentDidUpdate (prevProps) {
|
||||||
|
@ -9,19 +9,15 @@ export default function withTokenTracker (WrappedComponent) {
|
|||||||
token: PropTypes.object.isRequired,
|
token: PropTypes.object.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor (props) {
|
state = {
|
||||||
super(props)
|
string: '',
|
||||||
|
symbol: '',
|
||||||
this.state = {
|
balance: '',
|
||||||
string: '',
|
error: null,
|
||||||
symbol: '',
|
|
||||||
balance: '',
|
|
||||||
error: null,
|
|
||||||
}
|
|
||||||
|
|
||||||
this.tracker = null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tracker = null
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
this.createFreshTokenTracker()
|
this.createFreshTokenTracker()
|
||||||
}
|
}
|
||||||
|
@ -26,22 +26,18 @@ class AddToken extends Component {
|
|||||||
identities: PropTypes.object,
|
identities: PropTypes.object,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor (props) {
|
state = {
|
||||||
super(props)
|
customAddress: '',
|
||||||
|
customSymbol: '',
|
||||||
this.state = {
|
customDecimals: 0,
|
||||||
customAddress: '',
|
searchResults: [],
|
||||||
customSymbol: '',
|
selectedTokens: {},
|
||||||
customDecimals: 0,
|
tokenSelectorError: null,
|
||||||
searchResults: [],
|
customAddressError: null,
|
||||||
selectedTokens: {},
|
customSymbolError: null,
|
||||||
tokenSelectorError: null,
|
customDecimalsError: null,
|
||||||
customAddressError: null,
|
autoFilled: false,
|
||||||
customSymbolError: null,
|
forceEditSymbol: false,
|
||||||
customDecimalsError: null,
|
|
||||||
autoFilled: false,
|
|
||||||
forceEditSymbol: false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
|
@ -9,16 +9,13 @@ const { DEFAULT_ROUTE } = require('../../../helpers/constants/routes')
|
|||||||
const { formatBalance } = require('../../../helpers/utils/util')
|
const { formatBalance } = require('../../../helpers/utils/util')
|
||||||
|
|
||||||
class ConnectHardwareForm extends Component {
|
class ConnectHardwareForm extends Component {
|
||||||
constructor (props) {
|
state = {
|
||||||
super(props)
|
error: null,
|
||||||
this.state = {
|
selectedAccount: null,
|
||||||
error: null,
|
accounts: [],
|
||||||
selectedAccount: null,
|
browserSupported: true,
|
||||||
accounts: [],
|
unlocked: false,
|
||||||
browserSupported: true,
|
device: null,
|
||||||
unlocked: false,
|
|
||||||
device: null,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UNSAFE_componentWillReceiveProps (nextProps) {
|
UNSAFE_componentWillReceiveProps (nextProps) {
|
||||||
|
@ -4,14 +4,15 @@ import { DEFAULT_ROUTE } from '../../helpers/constants/routes'
|
|||||||
import Button from '../../components/ui/button'
|
import Button from '../../components/ui/button'
|
||||||
|
|
||||||
export default class NewAccountCreateForm extends Component {
|
export default class NewAccountCreateForm extends Component {
|
||||||
constructor (props, context) {
|
static defaultProps = {
|
||||||
super(props)
|
newAccountNumber: 0,
|
||||||
const { newAccountNumber = 0 } = props
|
}
|
||||||
|
|
||||||
this.state = {
|
state = {
|
||||||
newAccountName: '',
|
newAccountName: '',
|
||||||
defaultAccountName: context.t('newAccountNumberName', [newAccountNumber]),
|
defaultAccountName: this.context.t('newAccountNumberName', [
|
||||||
}
|
this.props.newAccountNumber,
|
||||||
|
]),
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
@ -23,18 +23,15 @@ export default class UnlockPage extends Component {
|
|||||||
showOptInModal: PropTypes.func,
|
showOptInModal: PropTypes.func,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor (props) {
|
state = {
|
||||||
super(props)
|
password: '',
|
||||||
|
error: null,
|
||||||
this.state = {
|
|
||||||
password: '',
|
|
||||||
error: null,
|
|
||||||
}
|
|
||||||
|
|
||||||
this.submitting = false
|
|
||||||
this.animationEventEmitter = new EventEmitter()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
submitting = false
|
||||||
|
|
||||||
|
animationEventEmitter = new EventEmitter()
|
||||||
|
|
||||||
UNSAFE_componentWillMount () {
|
UNSAFE_componentWillMount () {
|
||||||
const { isUnlocked, history } = this.props
|
const { isUnlocked, history } = this.props
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user