-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(coinbox): do not rerender the coin box unnecessarily (#6252)
- Loading branch information
1 parent
0d173ba
commit b336376
Showing
3 changed files
with
37 additions
and
51 deletions.
There are no files selected for viewing
53 changes: 24 additions & 29 deletions
53
packages/blockchain-wallet-v4-frontend/src/components/Form/SelectBoxBankAccountType/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,34 @@ | ||
import React from 'react' | ||
import { FormattedMessage } from 'react-intl' | ||
import { connect } from 'react-redux' | ||
|
||
import SelectBox from '../SelectBox' | ||
|
||
const ACCOUNT_TYPES = [ | ||
{ | ||
text: ( | ||
<FormattedMessage | ||
id='components.form.selectboxbankaccounttype.checking' | ||
defaultMessage='Checking' | ||
/> | ||
), | ||
value: 'checking' | ||
}, | ||
|
||
{ | ||
text: ( | ||
<FormattedMessage | ||
id='components.form.selectboxbankaccounttype.savings' | ||
defaultMessage='Savings' | ||
/> | ||
), | ||
value: 'savings' | ||
} | ||
] | ||
class SelectBoxBankAccountType extends React.PureComponent { | ||
render() { | ||
const { accountTypes, ...rest } = this.props | ||
const elements = [{ group: '', items: accountTypes }] | ||
return <SelectBox elements={elements} {...rest} /> | ||
const elements = [{ group: '', items: ACCOUNT_TYPES }] | ||
return <SelectBox elements={elements} {...this.props} /> | ||
} | ||
} | ||
|
||
const mapStateToProps = (state, ownProps) => ({ | ||
accountTypes: [ | ||
{ | ||
text: ( | ||
<FormattedMessage | ||
id='components.form.selectboxbankaccounttype.checking' | ||
defaultMessage='Checking' | ||
/> | ||
), | ||
value: 'checking' | ||
}, | ||
|
||
{ | ||
text: ( | ||
<FormattedMessage | ||
id='components.form.selectboxbankaccounttype.savings' | ||
defaultMessage='Savings' | ||
/> | ||
), | ||
value: 'savings' | ||
} | ||
] | ||
}) | ||
|
||
export default connect(mapStateToProps)(SelectBoxBankAccountType) | ||
export default SelectBoxBankAccountType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
...es/blockchain-wallet-v4-frontend/src/components/Form/SelectBoxCoinPriceChart/selectors.js
This file was deleted.
Oops, something went wrong.