Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Blockchain explorer links only ETH #317

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/components/Header/Polling.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useActiveNetworkVersion, useSubgraphStatus } from '../../state/applicat
import { ExplorerDataType, getExplorerLink } from '../../utils'
import useTheme from 'hooks/useTheme'
import { EthereumNetworkInfo } from 'constants/networks'
import { ChainId } from '@uniswap/sdk-core'

const StyledPolling = styled.div`
display: flex;
Expand Down Expand Up @@ -87,7 +86,7 @@ export default function Polling() {

return (
<ExternalLink
href={latestBlock ? getExplorerLink(ChainId.MAINNET, latestBlock.toString(), ExplorerDataType.BLOCK) : ''}
href={latestBlock ? getExplorerLink(activeNetwork.chainId, latestBlock.toString(), ExplorerDataType.BLOCK) : ''}
>
<StyledPolling>
<TYPE.small mr="4px" color={theme?.text3}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/TransactionsTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const DataRow = ({ transaction, color }: { transaction: Transaction; color?: str

return (
<ResponsiveGrid>
<ExternalLink href={getExplorerLink(ChainId.MAINNET, transaction.hash, ExplorerDataType.TRANSACTION)}>
<ExternalLink href={getExplorerLink(activeNetwork.chainId, transaction.hash, ExplorerDataType.TRANSACTION)}>
<Label color={color ?? theme?.blue1} fontWeight={400}>
{transaction.type === TransactionType.MINT
? `Add ${transaction.token0Symbol} and ${transaction.token1Symbol}`
Expand Down
3 changes: 1 addition & 2 deletions src/pages/Pool/PoolPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import { GenericImageWrapper } from 'components/Logo'
import { Navigate, useParams } from 'react-router-dom'
import { Trace } from '@uniswap/analytics'
import { InterfacePageName } from '@uniswap/analytics-events'
import { ChainId } from '@uniswap/sdk-core'

const ContentLayout = styled.div`
display: grid;
Expand Down Expand Up @@ -166,7 +165,7 @@ function PoolPage({ address }: { address: string }) {
</AutoRow>
<RowFixed gap="10px" align="center">
<SavedIcon fill={savedPools.includes(address)} onClick={() => addSavedPool(address)} />
<StyledExternalLink href={getExplorerLink(ChainId.MAINNET, address, ExplorerDataType.ADDRESS)}>
<StyledExternalLink href={getExplorerLink(activeNetwork.chainId, address, ExplorerDataType.ADDRESS)}>
<ExternalLink stroke={theme?.text2} size={'17px'} style={{ marginLeft: '12px' }} />
</StyledExternalLink>
</RowFixed>
Expand Down
5 changes: 2 additions & 3 deletions src/pages/Token/TokenPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import { useCMCLink } from 'hooks/useCMCLink'
import CMCLogo from '../../assets/images/cmc.png'
import { useParams } from 'react-router-dom'
import { Trace } from '@uniswap/analytics'
import { ChainId } from '@uniswap/sdk-core'

const PriceText = styled(TYPE.label)`
font-size: 36px;
Expand Down Expand Up @@ -191,7 +190,7 @@ export default function TokenPage() {
<TYPE.main>{` > `}</TYPE.main>
<TYPE.label>{` ${tokenData.symbol} `}</TYPE.label>
<StyledExternalLink
href={getExplorerLink(ChainId.MAINNET, formattedAddress, ExplorerDataType.ADDRESS)}
href={getExplorerLink(activeNetwork.chainId, formattedAddress, ExplorerDataType.ADDRESS)}
>
<TYPE.main>{` (${shortenAddress(formattedAddress)}) `}</TYPE.main>
</StyledExternalLink>
Expand All @@ -207,7 +206,7 @@ export default function TokenPage() {
</StyledExternalLink>
)}
<StyledExternalLink
href={getExplorerLink(ChainId.MAINNET, formattedAddress, ExplorerDataType.ADDRESS)}
href={getExplorerLink(activeNetwork.chainId, formattedAddress, ExplorerDataType.ADDRESS)}
>
<ExternalLink stroke={theme?.text2} size={'17px'} style={{ marginLeft: '12px' }} />
</StyledExternalLink>
Expand Down
Loading