mirror of
https://github.com/trezor/trezor-wallet
synced 2024-12-31 19:30:53 +00:00
removed <SelectedAccount> from components
This commit is contained in:
parent
b6843d0ad0
commit
8229317ccf
@ -11,8 +11,6 @@ import colors from 'config/colors';
|
|||||||
import Tooltip from 'components/Tooltip';
|
import Tooltip from 'components/Tooltip';
|
||||||
import { QRCode } from 'react-qr-svg';
|
import { QRCode } from 'react-qr-svg';
|
||||||
|
|
||||||
import SelectedAccount from 'views/Wallet/components/SelectedAccount';
|
|
||||||
|
|
||||||
import { FONT_SIZE, FONT_WEIGHT, FONT_FAMILY } from 'config/variables';
|
import { FONT_SIZE, FONT_WEIGHT, FONT_FAMILY } from 'config/variables';
|
||||||
|
|
||||||
import type { Props } from './Container';
|
import type { Props } from './Container';
|
||||||
@ -124,9 +122,10 @@ const AccountReceive = (props: Props) => {
|
|||||||
const {
|
const {
|
||||||
account,
|
account,
|
||||||
discovery,
|
discovery,
|
||||||
|
shouldRender,
|
||||||
} = props.selectedAccount;
|
} = props.selectedAccount;
|
||||||
|
|
||||||
if (!device || !account || !discovery) return null;
|
if (!device || !account || !discovery || !shouldRender) return null;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
addressVerified,
|
addressVerified,
|
||||||
@ -143,7 +142,6 @@ const AccountReceive = (props: Props) => {
|
|||||||
const isAddressHidden = !isAddressVerifying && !addressVerified && !addressUnverified;
|
const isAddressHidden = !isAddressVerifying && !addressVerified && !addressUnverified;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SelectedAccount {...props}>
|
|
||||||
<Content>
|
<Content>
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<H2>Receive Ethereum or tokens</H2>
|
<H2>Receive Ethereum or tokens</H2>
|
||||||
@ -219,7 +217,6 @@ const AccountReceive = (props: Props) => {
|
|||||||
</AddressWrapper>
|
</AddressWrapper>
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
</Content>
|
</Content>
|
||||||
</SelectedAccount>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ import colors from 'config/colors';
|
|||||||
import P from 'components/Paragraph';
|
import P from 'components/Paragraph';
|
||||||
import { H2 } from 'components/Heading';
|
import { H2 } from 'components/Heading';
|
||||||
import Content from 'views/Wallet/components/Content';
|
import Content from 'views/Wallet/components/Content';
|
||||||
import SelectedAccount from 'views/Wallet/components/SelectedAccount';
|
|
||||||
import type { Token } from 'flowtype';
|
import type { Token } from 'flowtype';
|
||||||
import AdvancedForm from './components/AdvancedForm';
|
import AdvancedForm from './components/AdvancedForm';
|
||||||
import PendingTransactions from './components/PendingTransactions';
|
import PendingTransactions from './components/PendingTransactions';
|
||||||
@ -176,6 +175,7 @@ const AccountSend = (props: Props) => {
|
|||||||
network,
|
network,
|
||||||
discovery,
|
discovery,
|
||||||
tokens,
|
tokens,
|
||||||
|
shouldRender,
|
||||||
} = props.selectedAccount;
|
} = props.selectedAccount;
|
||||||
const {
|
const {
|
||||||
address,
|
address,
|
||||||
@ -205,7 +205,7 @@ const AccountSend = (props: Props) => {
|
|||||||
onSend,
|
onSend,
|
||||||
} = props.sendFormActions;
|
} = props.sendFormActions;
|
||||||
|
|
||||||
if (!device || !account || !discovery || !network) return null;
|
if (!device || !account || !discovery || !network || !shouldRender) return null;
|
||||||
|
|
||||||
let isSendButtonDisabled: boolean = Object.keys(errors).length > 0 || total === '0' || amount.length === 0 || address.length === 0 || sending;
|
let isSendButtonDisabled: boolean = Object.keys(errors).length > 0 || total === '0' || amount.length === 0 || address.length === 0 || sending;
|
||||||
let sendButtonText: string = 'Send';
|
let sendButtonText: string = 'Send';
|
||||||
@ -230,7 +230,6 @@ const AccountSend = (props: Props) => {
|
|||||||
const isAdvancedSettingsHidden = !advanced;
|
const isAdvancedSettingsHidden = !advanced;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SelectedAccount {...props}>
|
|
||||||
<Content>
|
<Content>
|
||||||
<Wrapper>
|
<Wrapper>
|
||||||
<H2>Send Ethereum or tokens</H2>
|
<H2>Send Ethereum or tokens</H2>
|
||||||
@ -375,7 +374,6 @@ const AccountSend = (props: Props) => {
|
|||||||
)}
|
)}
|
||||||
</Wrapper>
|
</Wrapper>
|
||||||
</Content>
|
</Content>
|
||||||
</SelectedAccount>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ import Content from 'views/Wallet/components/Content';
|
|||||||
|
|
||||||
import CoinLogo from 'components/images/CoinLogo';
|
import CoinLogo from 'components/images/CoinLogo';
|
||||||
import * as stateUtils from 'reducers/utils';
|
import * as stateUtils from 'reducers/utils';
|
||||||
import SelectedAccount from 'views/Wallet/components/SelectedAccount';
|
|
||||||
import Link from 'components/Link';
|
import Link from 'components/Link';
|
||||||
import AccountBalance from './components/Balance';
|
import AccountBalance from './components/Balance';
|
||||||
import AddedToken from './components/Token';
|
import AddedToken from './components/Token';
|
||||||
@ -67,17 +66,17 @@ const AccountSummary = (props: Props) => {
|
|||||||
network,
|
network,
|
||||||
tokens,
|
tokens,
|
||||||
pending,
|
pending,
|
||||||
|
shouldRender,
|
||||||
} = props.selectedAccount;
|
} = props.selectedAccount;
|
||||||
|
|
||||||
// flow
|
// flow
|
||||||
if (!device || !account || !network) return <SelectedAccount {...props} />;
|
if (!device || !account || !network || !shouldRender) return null;
|
||||||
|
|
||||||
const explorerLink: string = `${network.explorer.address}${account.address}`;
|
const explorerLink: string = `${network.explorer.address}${account.address}`;
|
||||||
const pendingAmount: BigNumber = stateUtils.getPendingAmount(pending, network.symbol);
|
const pendingAmount: BigNumber = stateUtils.getPendingAmount(pending, network.symbol);
|
||||||
const balance: string = new BigNumber(account.balance).minus(pendingAmount).toString(10);
|
const balance: string = new BigNumber(account.balance).minus(pendingAmount).toString(10);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SelectedAccount {...props}>
|
|
||||||
<Content>
|
<Content>
|
||||||
<AccountHeading>
|
<AccountHeading>
|
||||||
<AccountName>
|
<AccountName>
|
||||||
@ -158,7 +157,6 @@ const AccountSummary = (props: Props) => {
|
|||||||
))}
|
))}
|
||||||
</AddedTokensWrapper>
|
</AddedTokensWrapper>
|
||||||
</Content>
|
</Content>
|
||||||
</SelectedAccount>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user