Skip to content

Commit fcacf70

Browse files
committed
link to uniswap pool in header
(cherry picked from commit 9c534ba)
1 parent 108918c commit fcacf70

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

src/shared/layout/components/Topnav.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import { Col, Menu, Row } from 'antd'
22
import { generatePath, Link, useParams } from 'react-router-dom'
3-
import { Notifications, WalletMenu } from '@/shared/web3'
3+
import { Notifications, useAddress, WalletMenu } from '@/shared/web3'
44
import logo from '@/assets/images/logo.png'
5-
import { useConnection } from 'wagmi'
5+
import { useAccount } from 'wagmi'
66
import { useActiveAccount } from 'thirdweb/react'
77

88
export default function Topnav() {
99
const params = useParams()
1010
const { isConnected, address } = useConnection()
1111
const activeAccount = useActiveAccount()
12+
const token = useAddress('Market#PexfiToken')
13+
const chainId = useChainId()
1214

1315
const navItems = [
1416
{
@@ -25,6 +27,19 @@ export default function Topnav() {
2527
},
2628
]
2729

30+
if (token && chainId) {
31+
let net: string;
32+
switch(chainId) {
33+
case 1: net = 'ethereum'; break;
34+
case 11155111: net = 'ethereum_sepolia'; break;
35+
}
36+
37+
navItems.push({
38+
key: 'own',
39+
label: <a target={'_blank'} href={'https://app.uniswap.org/explore/tokens/' + net + '/' + token}>Own</a>
40+
})
41+
}
42+
2843
const userMenuItems = [
2944
{
3045
label: (

0 commit comments

Comments
 (0)