1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-23 23:48:07 +00:00

Refactor "AccountSummary"

- since "AddedToken" handles only a single token now (60947cb535) the logic of handling an array of tokens is now here
- rename inner function to "AccountSummary"
This commit is contained in:
Vasek Mlejnsky 2018-08-30 12:18:55 +02:00
parent 60947cb535
commit 0df6590e72

View File

@ -15,7 +15,7 @@ import * as stateUtils from 'reducers/utils';
import SelectedAccount from 'views/Wallet/components/SelectedAccount';
import Link from 'components/Link';
import AccountBalance from './components/AccountBalance';
import SummaryTokens from './components/Tokens';
import AddedToken from './components/AddedToken';
import type { Props } from './Container';
@ -51,7 +51,9 @@ const AsyncSelectWrapper = styled.div`
padding: 0px 48px 32px 48px;
`;
const Summary = (props: Props) => {
const AddedTokensWrapper = styled.div``;
const AccountSummary = (props: Props) => {
const device = props.wallet.selectedDevice;
const {
account,
@ -139,13 +141,18 @@ const Summary = (props: Props) => {
/>
</AsyncSelectWrapper>
<SummaryTokens
pending={pending}
tokens={tokens}
removeToken={props.removeToken}
/>
<AddedTokensWrapper>
{tokens.map(token => (
<AddedToken
key={token.symbol}
token={token}
pending={pending}
removeToken={props.removeToken}
/>
))}
</AddedTokensWrapper>
</SelectedAccount>
);
};
export default Summary;
export default AccountSummary;