Skip to content

Commit 3083c78

Browse files
authored
Merge pull request #234 from chotacabras/master
fix: add chainId to the url of the item clicked in search bar
2 parents 887e453 + 5cc5797 commit 3083c78

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/components/light-search-bar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { WalletContext } from 'contexts/wallet-context'
1212
import { itemToStatusCode, STATUS_COLOR } from '../utils/item-status'
1313
import { useLazyQuery } from '@apollo/client'
1414
import ITEM_SEARCH_QUERY from '../utils/graphql/item-search'
15+
import { useWeb3Context } from 'web3-react'
1516

1617
const StyledSelect = styled(Select)`
1718
width: 100%;
@@ -61,6 +62,7 @@ const OptionItem = ({ item }) => {
6162
metaEvidence
6263
} = useContext(LightTCRViewContext)
6364
const { timestamp } = useContext(WalletContext)
65+
const web3Context = useWeb3Context()
6466
const [itemInfo, setItemInfo] = useState()
6567
const { metadata } = metaEvidence || {}
6668
const { isTCRofTCRs } = metadata || {}
@@ -130,7 +132,7 @@ const OptionItem = ({ item }) => {
130132
))
131133
)}
132134
</StyledFieldsContainer>
133-
<StyledLink to={`/tcr/${tcrAddress}/${itemID}`}>
135+
<StyledLink to={`/tcr/${web3Context.networkId}/${tcrAddress}/${itemID}`}>
134136
<Icon type="right-circle" style={{ fontSize: '24px' }} />
135137
</StyledLink>
136138
</StyledOptionItem>

src/components/search-bar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const OptionItem = ({ item: { itemID, columns = [], tcrAddress } }) => {
6464
metaEvidence
6565
} = useContext(TCRViewContext)
6666
const { timestamp } = useContext(WalletContext)
67+
const web3Context = useWeb3Context()
6768
const [itemInfo, setItemInfo] = useState()
6869
const { metadata } = metaEvidence || {}
6970
const { isTCRofTCRs } = metadata || {}
@@ -141,7 +142,7 @@ const OptionItem = ({ item: { itemID, columns = [], tcrAddress } }) => {
141142
))
142143
)}
143144
</StyledFieldsContainer>
144-
<StyledLink to={`/tcr/${tcrAddress}/${itemID}`}>
145+
<StyledLink to={`/tcr/${web3Context.networkId}/${tcrAddress}/${itemID}`}>
145146
<Icon type="right-circle" style={{ fontSize: '24px' }} />
146147
</StyledLink>
147148
</StyledOptionItem>

0 commit comments

Comments
 (0)