Skip to content

Commit

Permalink
Fix: use local ExplorerButton component (#2685)
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh authored Oct 24, 2023
1 parent 77f8862 commit 2bb71d1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/common/TokenExplorerLink/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import { type ReactElement } from 'react'
import { ExplorerButton } from '@safe-global/safe-react-components'

import ExplorerButton from '@/components/common/ExplorerButton'
import { useCurrentChain } from '@/hooks/useChains'
import { getBlockExplorerLink } from '@/utils/chains'
import { Typography } from '@mui/material'

const ExplorerLink = ({ address }: { address: string }): ReactElement | null => {
const currentChain = useCurrentChain()
const link = currentChain ? getBlockExplorerLink(currentChain, address) : undefined

if (!link) return null

return <ExplorerButton href={link.href} title={link.title} />
return (
<Typography component="span" color="border.main">
<ExplorerButton href={link.href} title={link.title} />
</Typography>
)
}

export default ExplorerLink

0 comments on commit 2bb71d1

Please sign in to comment.