mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-15 01:22:01 +00:00
wallet type tooltip message for disconnected device
This commit is contained in:
parent
fe5c50f2b3
commit
91109dce06
@ -189,7 +189,17 @@ class LeftNavigation extends React.PureComponent<Props, State> {
|
|||||||
const { selectedDevice } = props.wallet;
|
const { selectedDevice } = props.wallet;
|
||||||
const isDeviceAccessible = deviceUtils.isDeviceAccessible(selectedDevice);
|
const isDeviceAccessible = deviceUtils.isDeviceAccessible(selectedDevice);
|
||||||
const walletType = selectedDevice && !selectedDevice.useEmptyPassphrase ? 'hidden' : 'standard';
|
const walletType = selectedDevice && !selectedDevice.useEmptyPassphrase ? 'hidden' : 'standard';
|
||||||
const passphraseEnabled = selectedDevice && selectedDevice.features && selectedDevice.features.passphrase_protection;
|
const showWalletType = selectedDevice && selectedDevice.features && selectedDevice.features.passphrase_protection;
|
||||||
|
const isDeviceReady = selectedDevice && selectedDevice.connected && selectedDevice.available;
|
||||||
|
|
||||||
|
let walletTooltipMsg = `You are in your ${walletType} wallet.`;
|
||||||
|
if (isDeviceReady) {
|
||||||
|
walletTooltipMsg = walletType === 'standard'
|
||||||
|
? `${walletTooltipMsg} Click here to access your hidden wallet.`
|
||||||
|
: `${walletTooltipMsg} Click here to access your standard or another hidden wallet`;
|
||||||
|
} else {
|
||||||
|
walletTooltipMsg = `${walletTooltipMsg} To access other wallets please connect your device.`;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StickyContainer
|
<StickyContainer
|
||||||
@ -209,12 +219,9 @@ class LeftNavigation extends React.PureComponent<Props, State> {
|
|||||||
isOpen={this.props.wallet.dropdownOpened}
|
isOpen={this.props.wallet.dropdownOpened}
|
||||||
icon={(
|
icon={(
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{passphraseEnabled ? (
|
{showWalletType ? (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
content={walletType === 'standard'
|
content={walletTooltipMsg}
|
||||||
? 'You are in your standard wallet. Click here to access your hidden wallet.'
|
|
||||||
: 'You are in your hidden wallet. Click here to access your standard or another hidden wallet.'
|
|
||||||
}
|
|
||||||
maxWidth={200}
|
maxWidth={200}
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
delayed
|
delayed
|
||||||
@ -222,10 +229,12 @@ class LeftNavigation extends React.PureComponent<Props, State> {
|
|||||||
<WalletTypeIconWrapper>
|
<WalletTypeIconWrapper>
|
||||||
<WalletTypeIcon
|
<WalletTypeIcon
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
this.props.duplicateDevice(selectedDevice);
|
if (isDeviceReady) {
|
||||||
e.stopPropagation();
|
this.props.duplicateDevice(selectedDevice);
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
hoverColor={colors.TEXT_PRIMARY}
|
hoverColor={isDeviceReady ? colors.TEXT_PRIMARY : colors.TEXT_SECONDARY}
|
||||||
type={walletType}
|
type={walletType}
|
||||||
size={25}
|
size={25}
|
||||||
color={colors.TEXT_SECONDARY}
|
color={colors.TEXT_SECONDARY}
|
||||||
|
Loading…
Reference in New Issue
Block a user