Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion src/components/CCIP/Cards/NetworkCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function NetworkCard({ name, totalLanes, totalTokens, logo }: NetworkCardProps)
<div>
<h3>{name}</h3>
<p>
{totalLanes} lanes | {totalTokens} tokens
{totalLanes} {totalLanes > 1 ? "lanes" : "lane"} | {totalTokens} {totalTokens > 1 ? "tokens" : "token"}
</p>
</div>
</div>
Expand Down
14 changes: 11 additions & 3 deletions src/components/CCIP/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ function Search({ chains, tokens, small, environment, lanes }: SearchProps) {
{network.name}
{!small && (
<span>
{network.totalLanes} lanes | {network.totalTokens} tokens
{network.totalLanes} {network.totalLanes > 1 ? "lanes" : "lane"} | {network.totalTokens}{" "}
{network.totalTokens > 1 ? "tokens" : "token"}
</span>
)}
</a>
Expand All @@ -133,7 +134,11 @@ function Search({ chains, tokens, small, environment, lanes }: SearchProps) {
<a href={`/ccip/supported-networks/${environment}/token/${token.name}`}>
<img src={token.logo} alt="" />
{token.name}
{!small && <span>{token.totalNetworks} networks</span>}
{!small && (
<span>
{token.totalNetworks} {token.totalNetworks > 1 ? "networks" : "network"}
</span>
)}
</a>
</li>
))}
Expand Down Expand Up @@ -171,7 +176,10 @@ function Search({ chains, tokens, small, environment, lanes }: SearchProps) {
{lane.sourceNetwork.name} {">"} {lane.destinationNetwork.name}
{!small && (
<span>
{lane?.lane?.supportedTokens ? Object.keys(lane.lane.supportedTokens).length : 0} tokens
{lane?.lane?.supportedTokens ? Object.keys(lane.lane.supportedTokens).length : 0}{" "}
{lane.lane.supportedTokens && Object.keys(lane.lane.supportedTokens).length > 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add the ? here, otherwise it will trigger a JS error if missing

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's in the next line 181

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant this lane.lane.supportedTokens should be changed with lane?.lane?.supportedTokens

? "tokens"
: "token"}
</span>
)}
</a>
Expand Down