Skip to content

Commit 0e7423e

Browse files
committed
add unavailable and tooltip instead of N/A in lane table
1 parent ffa0c32 commit 0e7423e

File tree

2 files changed

+45
-7
lines changed

2 files changed

+45
-7
lines changed

src/components/CCIP/Drawer/LaneDrawer.tsx

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,31 @@ function LaneDrawer({
240240

241241
<td>
242242
{lane.supportedTokens &&
243-
displayCapacity(
244-
data[sourceNetwork.key].decimals,
245-
token,
246-
lane.supportedTokens[token]?.rateLimiterConfig?.[
247-
inOutbound === LaneFilter.Inbound ? "in" : "out"
248-
]
249-
)}
243+
(() => {
244+
const capacity = displayCapacity(
245+
data[sourceNetwork.key].decimals,
246+
token,
247+
lane.supportedTokens[token]?.rateLimiterConfig?.[
248+
inOutbound === LaneFilter.Inbound ? "in" : "out"
249+
]
250+
)
251+
return capacity === "N/A" ? (
252+
<Tooltip
253+
label="Unavailable"
254+
tip="Rate limit data is currently unavailable. You can find the Token Pool rate limit by reading the Token Pool contract directly on the relevant blockchain."
255+
labelStyle={{
256+
marginRight: "5px",
257+
}}
258+
style={{
259+
display: "inline-block",
260+
verticalAlign: "middle",
261+
marginBottom: "2px",
262+
}}
263+
/>
264+
) : (
265+
capacity
266+
)
267+
})()}
250268
</td>
251269
<td className="rate-tooltip-cell">
252270
{lane.supportedTokens && (
@@ -256,6 +274,7 @@ function LaneDrawer({
256274
symbol={token}
257275
decimals={data[sourceNetwork.key].decimals}
258276
position="left"
277+
showUnavailableText={true}
259278
/>
260279
)}
261280
</td>

src/components/CCIP/Tooltip/RateTooltip.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,33 @@ function RateTooltip({
77
symbol,
88
decimals,
99
position,
10+
showUnavailableText = false,
1011
}: {
1112
destinationLane: SupportedTokenConfig
1213
inOutbound: LaneFilter
1314
symbol: string
1415
decimals: number
1516
position?: "top" | "bottom" | "left" | "right"
17+
showUnavailableText?: boolean
1618
}) {
1719
if (!destinationLane.rateLimiterConfig?.[inOutbound === LaneFilter.Inbound ? "in" : "out"]?.isEnabled) {
20+
if (showUnavailableText) {
21+
return (
22+
<Tooltip
23+
label="Unavailable"
24+
tip="Rate limit data is currently unavailable. You can find the Token Pool rate limit by reading the Token Pool contract directly on the relevant blockchain."
25+
labelStyle={{
26+
marginRight: "5px",
27+
}}
28+
style={{
29+
display: "inline-block",
30+
verticalAlign: "middle",
31+
marginBottom: "2px",
32+
}}
33+
position={position}
34+
/>
35+
)
36+
}
1837
return <span>N/A</span>
1938
}
2039
const { rateSecond, maxThroughput } = displayRate(

0 commit comments

Comments
 (0)