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