|
|
@ -23,7 +23,7 @@ import { |
|
|
|
isBalanceCached, |
|
|
|
isBalanceCached, |
|
|
|
getSelectedAccount, |
|
|
|
getSelectedAccount, |
|
|
|
getShouldShowFiat, |
|
|
|
getShouldShowFiat, |
|
|
|
getCurrentNetworkId, |
|
|
|
getCurrentChainId, |
|
|
|
getCurrentKeyring, |
|
|
|
getCurrentKeyring, |
|
|
|
} from '../../../selectors/selectors' |
|
|
|
} from '../../../selectors/selectors' |
|
|
|
import SwapIcon from '../../ui/icon/swap-icon.component' |
|
|
|
import SwapIcon from '../../ui/icon/swap-icon.component' |
|
|
@ -34,7 +34,7 @@ import { |
|
|
|
setSwapsFromToken, |
|
|
|
setSwapsFromToken, |
|
|
|
} from '../../../ducks/swaps/swaps' |
|
|
|
} from '../../../ducks/swaps/swaps' |
|
|
|
import IconButton from '../../ui/icon-button' |
|
|
|
import IconButton from '../../ui/icon-button' |
|
|
|
import { MAINNET_NETWORK_ID } from '../../../../../app/scripts/controllers/network/enums' |
|
|
|
import { MAINNET_CHAIN_ID } from '../../../../../app/scripts/controllers/network/enums' |
|
|
|
import WalletOverview from './wallet-overview' |
|
|
|
import WalletOverview from './wallet-overview' |
|
|
|
|
|
|
|
|
|
|
|
const EthOverview = ({ className }) => { |
|
|
|
const EthOverview = ({ className }) => { |
|
|
@ -61,7 +61,7 @@ const EthOverview = ({ className }) => { |
|
|
|
const showFiat = useSelector(getShouldShowFiat) |
|
|
|
const showFiat = useSelector(getShouldShowFiat) |
|
|
|
const selectedAccount = useSelector(getSelectedAccount) |
|
|
|
const selectedAccount = useSelector(getSelectedAccount) |
|
|
|
const { balance } = selectedAccount |
|
|
|
const { balance } = selectedAccount |
|
|
|
const networkId = useSelector(getCurrentNetworkId) |
|
|
|
const chainId = useSelector(getCurrentChainId) |
|
|
|
const enteredSwapsEvent = useNewMetricEvent({ |
|
|
|
const enteredSwapsEvent = useNewMetricEvent({ |
|
|
|
event: 'Swaps Opened', |
|
|
|
event: 'Swaps Opened', |
|
|
|
properties: { source: 'Main View', active_currency: 'ETH' }, |
|
|
|
properties: { source: 'Main View', active_currency: 'ETH' }, |
|
|
@ -134,10 +134,10 @@ const EthOverview = ({ className }) => { |
|
|
|
{swapsEnabled ? ( |
|
|
|
{swapsEnabled ? ( |
|
|
|
<IconButton |
|
|
|
<IconButton |
|
|
|
className="eth-overview__button" |
|
|
|
className="eth-overview__button" |
|
|
|
disabled={networkId !== MAINNET_NETWORK_ID} |
|
|
|
disabled={chainId !== MAINNET_CHAIN_ID} |
|
|
|
Icon={SwapIcon} |
|
|
|
Icon={SwapIcon} |
|
|
|
onClick={() => { |
|
|
|
onClick={() => { |
|
|
|
if (networkId === MAINNET_NETWORK_ID) { |
|
|
|
if (chainId === MAINNET_CHAIN_ID) { |
|
|
|
enteredSwapsEvent() |
|
|
|
enteredSwapsEvent() |
|
|
|
dispatch(setSwapsFromToken(swapsEthToken)) |
|
|
|
dispatch(setSwapsFromToken(swapsEthToken)) |
|
|
|
if (usingHardwareWallet) { |
|
|
|
if (usingHardwareWallet) { |
|
|
@ -152,7 +152,7 @@ const EthOverview = ({ className }) => { |
|
|
|
<Tooltip |
|
|
|
<Tooltip |
|
|
|
title={t('onlyAvailableOnMainnet')} |
|
|
|
title={t('onlyAvailableOnMainnet')} |
|
|
|
position="bottom" |
|
|
|
position="bottom" |
|
|
|
disabled={networkId === '1'} |
|
|
|
disabled={chainId === MAINNET_CHAIN_ID} |
|
|
|
> |
|
|
|
> |
|
|
|
{contents} |
|
|
|
{contents} |
|
|
|
</Tooltip> |
|
|
|
</Tooltip> |
|
|
|