Skip to content

Commit ea47250

Browse files
authored
Merge pull request #251 from kleros/fix/invalid-list-url
fix(tcr-card): use valid networkId in place of undefined chainId
2 parents 9ee30ac + 122f8bb commit ea47250

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

src/components/light-tcr-card-content.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,10 @@ const StyledResult = styled(Result)`
2929

3030
const TCRCardContent = ({
3131
tcrAddress,
32-
chainId,
3332
currentTCRAddress,
3433
ID,
3534
hideDetailsButton
3635
}) => {
37-
console.log({
38-
tcrAddress,
39-
currentTCRAddress,
40-
ID,
41-
hideDetailsButton
42-
})
4336
const { library, active, networkId } = useWeb3Context()
4437
const [error, setError] = useState()
4538
const gtcr = useMemo(() => {
@@ -83,12 +76,12 @@ const TCRCardContent = ({
8376
</StyledItemCol>
8477
<StyledItemCol>
8578
{!hideDetailsButton && (
86-
<Link to={`/tcr/${chainId}/${currentTCRAddress}/${ID}`}>
79+
<Link to={`/tcr/${networkId}/${currentTCRAddress}/${ID}`}>
8780
<Button>Details</Button>
8881
</Link>
8982
)}
9083
<Link
91-
to={`/tcr/${chainId}/${tcrAddress}`}
84+
to={`/tcr/${networkId}/${tcrAddress}`}
9285
style={{ marginLeft: '12px' }}
9386
>
9487
<Button type="primary">Open List</Button>
@@ -130,12 +123,12 @@ const TCRCardContent = ({
130123
</div>
131124
<StyledItemCol>
132125
{!hideDetailsButton && (
133-
<Link to={`/tcr/${chainId}/${currentTCRAddress}/${ID}`}>
126+
<Link to={`/tcr/${networkId}/${currentTCRAddress}/${ID}`}>
134127
<Button>Details</Button>
135128
</Link>
136129
)}
137130
<Link
138-
to={`/tcr/${chainId}/${tcrAddress}`}
131+
to={`/tcr/${networkId}/${tcrAddress}`}
139132
style={{ marginLeft: '12px' }}
140133
>
141134
<Button type="primary">Open List</Button>

src/components/tcr-card-content.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const StyledResult = styled(Result)`
2929

3030
const TCRCardContent = ({
3131
tcrAddress,
32-
chainId,
3332
currentTCRAddress,
3433
ID,
3534
hideDetailsButton
@@ -77,12 +76,12 @@ const TCRCardContent = ({
7776
</StyledItemCol>
7877
<StyledItemCol>
7978
{!hideDetailsButton && (
80-
<Link to={`/tcr/${chainId}/${currentTCRAddress}/${ID}`}>
79+
<Link to={`/tcr/${networkId}/${currentTCRAddress}/${ID}`}>
8180
<Button>Details</Button>
8281
</Link>
8382
)}
8483
<Link
85-
to={`/tcr/${chainId}/${tcrAddress}`}
84+
to={`/tcr/${networkId}/${tcrAddress}`}
8685
style={{ marginLeft: '12px' }}
8786
>
8887
<Button type="primary">Open List</Button>
@@ -124,12 +123,12 @@ const TCRCardContent = ({
124123
</div>
125124
<StyledItemCol>
126125
{!hideDetailsButton && (
127-
<Link to={`/tcr/${chainId}/${currentTCRAddress}/${ID}`}>
126+
<Link to={`/tcr/${networkId}/${currentTCRAddress}/${ID}`}>
128127
<Button>Details</Button>
129128
</Link>
130129
)}
131130
<Link
132-
to={`/tcr/${chainId}/${tcrAddress}`}
131+
to={`/tcr/${networkId}/${tcrAddress}`}
133132
style={{ marginLeft: '12px' }}
134133
>
135134
<Button type="primary">Open List</Button>

src/pages/items/item-card.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ const CardItemInfo = ({
134134
content = isTCRofTCRs ? (
135135
<TCRCardContent
136136
ID={item.tcrData.ID}
137-
chainId={chainId}
138137
tcrAddress={item.columns[0].value}
139138
itemName={itemName}
140139
currentTCRAddress={tcrAddress}

src/pages/light-items/item-card.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ const CardItemInfo = ({
134134
content = isTCRofTCRs ? (
135135
<TCRCardContent
136136
ID={item.tcrData.ID}
137-
chainId={chainId}
138137
tcrAddress={item.columns[0].value}
139138
itemName={itemName}
140139
currentTCRAddress={tcrAddress}

0 commit comments

Comments
 (0)