mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-05 21:00:58 +00:00
update UI for the imported accounts
This commit is contained in:
parent
732c767ea3
commit
6d76c20886
@ -95,10 +95,11 @@ const AccountReceive = (props: Props) => {
|
|||||||
const isAddressVerifying =
|
const isAddressVerifying =
|
||||||
props.modal.context === CONTEXT_DEVICE &&
|
props.modal.context === CONTEXT_DEVICE &&
|
||||||
props.modal.windowType === 'ButtonRequest_Address';
|
props.modal.windowType === 'ButtonRequest_Address';
|
||||||
const isAddressHidden = !isAddressVerifying && !addressVerified && !addressUnverified;
|
const isAddressHidden =
|
||||||
|
!isAddressVerifying && !addressVerified && !addressUnverified && !account.imported;
|
||||||
|
|
||||||
let address = `${account.descriptor.substring(0, 20)}...`;
|
let address = `${account.descriptor.substring(0, 20)}...`;
|
||||||
if (addressVerified || addressUnverified || isAddressVerifying) {
|
if (addressVerified || addressUnverified || isAddressVerifying || account.imported) {
|
||||||
address = account.descriptor;
|
address = account.descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +167,7 @@ const AccountReceive = (props: Props) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{!(addressVerified || addressUnverified) && (
|
{!(addressVerified || addressUnverified) && !account.imported && (
|
||||||
<ShowAddressButton
|
<ShowAddressButton
|
||||||
icon={ICONS.EYE}
|
icon={ICONS.EYE}
|
||||||
onClick={() => props.showAddress(account.accountPath)}
|
onClick={() => props.showAddress(account.accountPath)}
|
||||||
@ -176,7 +177,8 @@ const AccountReceive = (props: Props) => {
|
|||||||
</ShowAddressButton>
|
</ShowAddressButton>
|
||||||
)}
|
)}
|
||||||
</Row>
|
</Row>
|
||||||
{(addressVerified || addressUnverified) && !isAddressVerifying && (
|
{((addressVerified || addressUnverified) && !isAddressVerifying) ||
|
||||||
|
(account.imported && (
|
||||||
<QrWrapper>
|
<QrWrapper>
|
||||||
<Label>
|
<Label>
|
||||||
<FormattedMessage {...l10nReceiveMessages.TR_QR_CODE} />
|
<FormattedMessage {...l10nReceiveMessages.TR_QR_CODE} />
|
||||||
@ -189,7 +191,7 @@ const AccountReceive = (props: Props) => {
|
|||||||
value={account.descriptor}
|
value={account.descriptor}
|
||||||
/>
|
/>
|
||||||
</QrWrapper>
|
</QrWrapper>
|
||||||
)}
|
))}
|
||||||
</AddressWrapper>
|
</AddressWrapper>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
</Content>
|
</Content>
|
||||||
|
@ -101,10 +101,11 @@ const AccountReceive = (props: Props) => {
|
|||||||
const isAddressVerifying =
|
const isAddressVerifying =
|
||||||
props.modal.context === CONTEXT_DEVICE &&
|
props.modal.context === CONTEXT_DEVICE &&
|
||||||
props.modal.windowType === 'ButtonRequest_Address';
|
props.modal.windowType === 'ButtonRequest_Address';
|
||||||
const isAddressHidden = !isAddressVerifying && !addressVerified && !addressUnverified;
|
const isAddressHidden =
|
||||||
|
!isAddressVerifying && !addressVerified && !addressUnverified && !account.imported;
|
||||||
|
|
||||||
let address = `${account.descriptor.substring(0, 20)}...`;
|
let address = `${account.descriptor.substring(0, 20)}...`;
|
||||||
if (addressVerified || addressUnverified || isAddressVerifying) {
|
if (addressVerified || addressUnverified || isAddressVerifying || account.imported) {
|
||||||
address = account.descriptor;
|
address = account.descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,7 +173,7 @@ const AccountReceive = (props: Props) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{!(addressVerified || addressUnverified) && (
|
{!(addressVerified || addressUnverified) && !account.imported && (
|
||||||
<ShowAddressButton
|
<ShowAddressButton
|
||||||
onClick={() => props.showAddress(account.accountPath)}
|
onClick={() => props.showAddress(account.accountPath)}
|
||||||
isDisabled={device.connected && !discovery.completed}
|
isDisabled={device.connected && !discovery.completed}
|
||||||
@ -182,7 +183,8 @@ const AccountReceive = (props: Props) => {
|
|||||||
</ShowAddressButton>
|
</ShowAddressButton>
|
||||||
)}
|
)}
|
||||||
</Row>
|
</Row>
|
||||||
{(addressVerified || addressUnverified) && !isAddressVerifying && (
|
{((addressVerified || addressUnverified) && !isAddressVerifying) ||
|
||||||
|
(account.imported && (
|
||||||
<QrWrapper>
|
<QrWrapper>
|
||||||
<Label>
|
<Label>
|
||||||
<FormattedMessage {...l10nReceiveMessages.TR_QR_CODE} />
|
<FormattedMessage {...l10nReceiveMessages.TR_QR_CODE} />
|
||||||
@ -195,7 +197,7 @@ const AccountReceive = (props: Props) => {
|
|||||||
value={account.descriptor}
|
value={account.descriptor}
|
||||||
/>
|
/>
|
||||||
</QrWrapper>
|
</QrWrapper>
|
||||||
)}
|
))}
|
||||||
</AddressWrapper>
|
</AddressWrapper>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
</Content>
|
</Content>
|
||||||
|
@ -312,7 +312,9 @@ const AccountSend = (props: Props) => {
|
|||||||
total === '0' ||
|
total === '0' ||
|
||||||
amount.length === 0 ||
|
amount.length === 0 ||
|
||||||
address.length === 0 ||
|
address.length === 0 ||
|
||||||
sending;
|
sending ||
|
||||||
|
account.imported;
|
||||||
|
|
||||||
let amountText = '';
|
let amountText = '';
|
||||||
if (networkSymbol !== currency && amount.length > 0 && !errors.amount) {
|
if (networkSymbol !== currency && amount.length > 0 && !errors.amount) {
|
||||||
amountText = `${amount} ${currency.toUpperCase()}`;
|
amountText = `${amount} ${currency.toUpperCase()}`;
|
||||||
@ -516,13 +518,14 @@ const AccountSend = (props: Props) => {
|
|||||||
</AdvancedForm>
|
</AdvancedForm>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{props.selectedAccount.pending.length > 0 && (
|
{props.selectedAccount.pending.length > 0 ||
|
||||||
|
(account.imported && (
|
||||||
<PendingTransactions
|
<PendingTransactions
|
||||||
pending={props.selectedAccount.pending}
|
pending={props.selectedAccount.pending}
|
||||||
tokens={props.selectedAccount.tokens}
|
tokens={props.selectedAccount.tokens}
|
||||||
network={network}
|
network={network}
|
||||||
/>
|
/>
|
||||||
)}
|
))}
|
||||||
</Content>
|
</Content>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -279,7 +279,9 @@ const AccountSend = (props: Props) => {
|
|||||||
total === '0' ||
|
total === '0' ||
|
||||||
amount.length === 0 ||
|
amount.length === 0 ||
|
||||||
address.length === 0 ||
|
address.length === 0 ||
|
||||||
sending;
|
sending ||
|
||||||
|
account.imported;
|
||||||
|
|
||||||
let sendButtonText = <FormattedMessage {...l10nSendMessages.TR_SEND} values={{ amount: '' }} />;
|
let sendButtonText = <FormattedMessage {...l10nSendMessages.TR_SEND} values={{ amount: '' }} />;
|
||||||
if (total !== '0') {
|
if (total !== '0') {
|
||||||
sendButtonText = (
|
sendButtonText = (
|
||||||
@ -481,13 +483,14 @@ const AccountSend = (props: Props) => {
|
|||||||
</AdvancedForm>
|
</AdvancedForm>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{props.selectedAccount.pending.length > 0 && (
|
{props.selectedAccount.pending.length > 0 ||
|
||||||
|
(account.imported && (
|
||||||
<PendingTransactions
|
<PendingTransactions
|
||||||
pending={props.selectedAccount.pending}
|
pending={props.selectedAccount.pending}
|
||||||
tokens={props.selectedAccount.tokens}
|
tokens={props.selectedAccount.tokens}
|
||||||
network={network}
|
network={network}
|
||||||
/>
|
/>
|
||||||
)}
|
))}
|
||||||
</Content>
|
</Content>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -44,6 +44,10 @@ const StyledCoinLogo = styled(CoinLogo)`
|
|||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const StyledLink = styled(Link)`
|
||||||
|
font-size: ${FONT_SIZE.SMALL};
|
||||||
|
`;
|
||||||
|
|
||||||
const AccountSummary = (props: Props) => {
|
const AccountSummary = (props: Props) => {
|
||||||
const device = props.wallet.selectedDevice;
|
const device = props.wallet.selectedDevice;
|
||||||
const { account, network, pending, shouldRender } = props.selectedAccount;
|
const { account, network, pending, shouldRender } = props.selectedAccount;
|
||||||
@ -69,17 +73,19 @@ const AccountSummary = (props: Props) => {
|
|||||||
<StyledCoinLogo height={23} network={account.network} />
|
<StyledCoinLogo height={23} network={account.network} />
|
||||||
<AccountTitle>
|
<AccountTitle>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
{...l10nCommonMessages.TR_ACCOUNT_HASH}
|
{...(account.imported
|
||||||
|
? l10nCommonMessages.TR_IMPORTED_ACCOUNT_HASH
|
||||||
|
: l10nCommonMessages.TR_ACCOUNT_HASH)}
|
||||||
values={{ number: parseInt(account.index, 10) + 1 }}
|
values={{ number: parseInt(account.index, 10) + 1 }}
|
||||||
/>
|
/>
|
||||||
</AccountTitle>
|
</AccountTitle>
|
||||||
</AccountName>
|
</AccountName>
|
||||||
{!account.empty && (
|
{!account.empty && (
|
||||||
<Link href={explorerLink} isGray>
|
<StyledLink href={explorerLink} isGray>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
{...l10nSummaryMessages.TR_SEE_FULL_TRANSACTION_HISTORY}
|
{...l10nSummaryMessages.TR_SEE_FULL_TRANSACTION_HISTORY}
|
||||||
/>
|
/>
|
||||||
</Link>
|
</StyledLink>
|
||||||
)}
|
)}
|
||||||
</AccountHeading>
|
</AccountHeading>
|
||||||
<AccountBalance
|
<AccountBalance
|
||||||
|
Loading…
Reference in New Issue
Block a user