From 7cb6ece160995843ac8754bdb7667e8927ceff26 Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Wed, 5 Jun 2024 16:26:15 -0500 Subject: [PATCH 1/7] init --- .../supported-networks/LaneConfig.astro | 37 ++-- .../SimplePreactTooltip.tsx | 56 ++++++ .../supported-networks/TokenSearch.tsx | 186 ++++++++++++++++++ 3 files changed, 259 insertions(+), 20 deletions(-) create mode 100644 src/features/ccip/components/supported-networks/SimplePreactTooltip.tsx create mode 100644 src/features/ccip/components/supported-networks/TokenSearch.tsx diff --git a/src/features/ccip/components/supported-networks/LaneConfig.astro b/src/features/ccip/components/supported-networks/LaneConfig.astro index 8d8edb51f20..dcc156e5b3c 100644 --- a/src/features/ccip/components/supported-networks/LaneConfig.astro +++ b/src/features/ccip/components/supported-networks/LaneConfig.astro @@ -4,7 +4,7 @@ import { Environment, Version, PoolType, - LaneConfig, + type LaneConfig, determineTokenMechanism, TokenMechanism, } from "@config/data/ccip/" @@ -14,6 +14,7 @@ import BigNumber from "bignumber.js" import { utils } from "ethers" import { getExplorer, getExplorerAddressUrl } from "@features/utils" import { Tooltip } from "@features/common/Tooltip" +import TokenSearch from "./TokenSearch" type ConfigProps = { laneConfig: LaneConfig @@ -242,7 +243,8 @@ if (supportedTokens) {

Transferable tokens

-
+ + {/*
@@ -279,33 +281,28 @@ if (supportedTokens) { - {tokensWithExtraInfo.map((tokenWithExtraInfo) => { + {filteredTokens.map((token) => { return ( - + - - + +
{tokenWithExtraInfo.token}{token.token} -
+
{tokenWithExtraInfo.decimals}{tokenWithExtraInfo.poolMechanism}{token.decimals}{token.poolMechanism} - {tokenWithExtraInfo.rateLimiterConfig?.isEnabled - ? display(tokenWithExtraInfo.rateLimiterConfig.capacity, tokenWithExtraInfo.decimals) + - " " + - tokenWithExtraInfo.token + {token.rateLimiterConfig?.isEnabled + ? display(token.rateLimiterConfig.capacity, token.decimals) + " " + token.token : "N/A"} - {tokenWithExtraInfo.rateLimiterConfig?.isEnabled + {token.rateLimiterConfig?.isEnabled ? (() => { const { rateSecond, maxThroughput } = displayRate( - tokenWithExtraInfo.rateLimiterConfig.capacity, - tokenWithExtraInfo.rateLimiterConfig.rate, - tokenWithExtraInfo.token, - tokenWithExtraInfo.decimals + token.rateLimiterConfig.capacity, + token.rateLimiterConfig.rate, + token.token, + token.decimals ) return ( @@ -324,7 +321,7 @@ if (supportedTokens) { })}
-
+
*/} ) : ( diff --git a/src/features/ccip/components/supported-networks/SimplePreactTooltip.tsx b/src/features/ccip/components/supported-networks/SimplePreactTooltip.tsx new file mode 100644 index 00000000000..b1cea277fc1 --- /dev/null +++ b/src/features/ccip/components/supported-networks/SimplePreactTooltip.tsx @@ -0,0 +1,56 @@ +/** @jsxImportSource preact */ +import { useState } from "preact/hooks" + +export const SimplePreactTooltip = ({ + label, + tip, + imgURL = "https://smartcontract.imgix.net/icons/info.svg?auto=compress%2Cformat", + labelStyle = {}, + tooltipStyle = {}, +}) => { + const [isVisible, setIsVisible] = useState(false) + + const containerStyle = { + display: "flex", + alignItems: "center", + justifyContent: "center", + cursor: "help", + ...labelStyle, + } + + const iconStyle = { + width: "0.8em", + height: "0.8em", + marginLeft: "2px", + marginRight: "5px", + } + + const defaultTooltipStyle = { + position: "absolute", + backgroundColor: "white", + color: "var(--color-text-secondary)", + padding: "8px 12px", + borderRadius: "4px", + bottom: "110%", + left: "50%", + transform: "translateX(-50%) translateY(0)", + whiteSpace: "normal", + display: isVisible ? "block" : "none", + fontSize: "12px", + fontWeight: "normal", + maxWidth: "200px", + textAlign: "center", + boxShadow: "0 2px 4px rgba(0,0,0,0.2)", + ...tooltipStyle, + } + + return ( +
+
setIsVisible(true)} onMouseLeave={() => setIsVisible(false)}> + {label} + Info +
+ {isVisible &&
{tip}
} +
+ ) +} diff --git a/src/features/ccip/components/supported-networks/TokenSearch.tsx b/src/features/ccip/components/supported-networks/TokenSearch.tsx new file mode 100644 index 00000000000..93f1fda6262 --- /dev/null +++ b/src/features/ccip/components/supported-networks/TokenSearch.tsx @@ -0,0 +1,186 @@ +/** @jsxImportSource preact */ +import { useState } from "preact/hooks" +import { FunctionComponent } from "preact" +import BigNumber from "bignumber.js" +import { utils } from "ethers" +import { SimplePreactTooltip } from "./SimplePreactTooltip" + +interface TokenExtraInfo { + token: string + address: string + rateLimiterConfig: { + capacity: string + isEnabled: boolean + rate: string + } + decimals: number + poolMechanism?: string +} + +interface TokenSearchProps { + tokens: TokenExtraInfo[] +} + +const normalizeNumber = (bigNum: BigNumber, decimals = 18) => { + const divisor = new BigNumber(10).pow(decimals) + const normalized = bigNum.dividedBy(divisor) + + return normalized.toNumber() +} + +const display = (bigNum: string, decimals = 18) => { + const numberWithoutDecimals = normalizeNumber(new BigNumber(bigNum), decimals).toString() + return utils.commify(numberWithoutDecimals) +} + +const formatTime = (seconds: number) => { + const minute = 60 + const hour = 3600 // 60*60 + + if (seconds < minute) { + return `${seconds} second${seconds > 1 ? "s" : ""}` + } else if (seconds < hour && hour - seconds > 300) { + // if the difference less than 5 minutes(300 seconds), round to hours + const minutes = Math.round(seconds / minute) + return `${minutes} minute${minutes > 1 ? "s" : ""}` + } else { + let hours = Math.floor(seconds / hour) + const remainingSeconds = seconds % hour + + // Determine the nearest 5-minute interval + let minutes = Math.round(remainingSeconds / minute / 5) * 5 + + // Round up to the next hour if minutes are 60 + if (minutes === 60) { + hours += 1 + minutes = 0 + } + + return `${hours}${ + minutes > 0 + ? ` hour${hours > 1 ? "s" : ""} and ${minutes} minute${minutes > 1 ? "s" : ""}` + : ` hour${hours > 1 ? "s" : ""}` + }` + } +} + +const displayRate = (capacity: string, rate: string, symbol: string, decimals = 18) => { + const capacityNormalized = normalizeNumber(new BigNumber(capacity), decimals) // normalize capacity + const rateNormalized = normalizeNumber(new BigNumber(rate), decimals) // normalize capacity + + const totalRefillTime = capacityNormalized / rateNormalized // in seconds + const displayTime = `${formatTime(totalRefillTime)}` + + return { + rateSecond: `${rateNormalized} ${symbol}/second`, + maxThroughput: `Refills from 0 to ${utils.commify(capacityNormalized)} ${symbol} in ${displayTime}`, + } +} + +const TokenSearch: FunctionComponent = ({ tokens }) => { + const [searchTerm, setSearchTerm] = useState("") + const [filteredTokens, setFilteredTokens] = useState(tokens) + + const handleInput = (event) => { + const newSearchTerm = event.currentTarget.value.toLowerCase() + setSearchTerm(newSearchTerm) + const newFilteredTokens = tokens.filter((token) => token.token.toLowerCase().includes(newSearchTerm)) + setFilteredTokens(newFilteredTokens) + } + + return ( + <> + +
+
+ + + + + + + + + + + + + {filteredTokens.length > 0 ? ( + filteredTokens.map((token) => ( + + + + + + + + + )) + ) : ( + + + + )} + +
SymbolToken AddressDecimals +
+ +
+
+
+ +
+
+
+ +
+
{token.token}{token.address}{token.decimals}{token.poolMechanism} + {token.rateLimiterConfig?.isEnabled + ? display(token.rateLimiterConfig.capacity, token.decimals) + " " + token.token + : "N/A"} + + {token.rateLimiterConfig?.isEnabled + ? (() => { + const { rateSecond, maxThroughput } = displayRate( + token.rateLimiterConfig.capacity, + token.rateLimiterConfig.rate, + token.token, + token.decimals + ) + return ( +
+ +
+ ) + })() + : "N/A"} +
+ No token found +
+
+
+ + ) +} + +export default TokenSearch From 56c2178a63f55f5100cdad2accdf48909cd7b420 Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Wed, 5 Jun 2024 20:23:54 -0500 Subject: [PATCH 2/7] SimplePreactAddress --- .../supported-networks/LaneConfig.astro | 6 ++- .../SimplePreactAddress.tsx | 53 +++++++++++++++++++ .../supported-networks/TokenSearch.tsx | 18 ++++++- 3 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 src/features/ccip/components/supported-networks/SimplePreactAddress.tsx diff --git a/src/features/ccip/components/supported-networks/LaneConfig.astro b/src/features/ccip/components/supported-networks/LaneConfig.astro index dcc156e5b3c..aa0e7975614 100644 --- a/src/features/ccip/components/supported-networks/LaneConfig.astro +++ b/src/features/ccip/components/supported-networks/LaneConfig.astro @@ -50,7 +50,7 @@ const display = (bigNum: string, decimals: number = 18) => { return utils.commify(numberWithoutDecimals) } -const formatTime = (seconds: number) => { +export const formatTime = (seconds: number) => { const minute = 60 const hour = 3600 // 60*60 @@ -165,6 +165,8 @@ if (supportedTokens) { .filter((item): item is TokenExtraInfo => item !== null && item.token !== undefined) .sort((itemA, itemB) => itemA.token.localeCompare(itemB.token, undefined, { sensitivity: "base" })) } + +// const filteredTokens = tokensWithExtraInfo --- @@ -243,7 +245,7 @@ if (supportedTokens) {

Transferable tokens

- + {/*
diff --git a/src/features/ccip/components/supported-networks/SimplePreactAddress.tsx b/src/features/ccip/components/supported-networks/SimplePreactAddress.tsx new file mode 100644 index 00000000000..eeb56535497 --- /dev/null +++ b/src/features/ccip/components/supported-networks/SimplePreactAddress.tsx @@ -0,0 +1,53 @@ +/** @jsxImportSource preact */ +import { useState } from "preact/hooks" + +export const SimplePreactAddress = ({ contractUrl, address, endLength = 6, urlClass = "", urlId = "" }) => { + address = address || contractUrl.split("/").pop() + const [isCopied, setIsCopied] = useState(false) + + const containerStyle = { + display: "inline-flex", + alignItems: "center", + gap: "--space-1x", + wordBreak: "break-word", + } + + const linkStyle = { + background: "#f0f0f0", + padding: "1px 5px", + borderRadius: "5px", + wordBreak: "break-word", + } + + const buttonStyle = { + background: "none", + border: "none", + cursor: "pointer", + height: "16px", + width: "16px", + minWidth: "12px", + } + + const formattedAddress = + endLength && address ? `${address.slice(0, endLength + 2)}...${address.slice(-endLength)}` : address + + const handleCopy = async () => { + await navigator.clipboard.writeText(address) + setIsCopied(true) + setTimeout(() => setIsCopied(false), 2000) + } + + return ( + + + {formattedAddress} + + + + ) +} diff --git a/src/features/ccip/components/supported-networks/TokenSearch.tsx b/src/features/ccip/components/supported-networks/TokenSearch.tsx index 93f1fda6262..ce2c21a7b87 100644 --- a/src/features/ccip/components/supported-networks/TokenSearch.tsx +++ b/src/features/ccip/components/supported-networks/TokenSearch.tsx @@ -3,6 +3,9 @@ import { useState } from "preact/hooks" import { FunctionComponent } from "preact" import BigNumber from "bignumber.js" import { utils } from "ethers" +import { SupportedChain } from "@config" +import { getExplorer, getExplorerAddressUrl } from "@features/utils" +import { SimplePreactAddress } from "./SimplePreactAddress" import { SimplePreactTooltip } from "./SimplePreactTooltip" interface TokenExtraInfo { @@ -19,6 +22,7 @@ interface TokenExtraInfo { interface TokenSearchProps { tokens: TokenExtraInfo[] + sourceChain: SupportedChain } const normalizeNumber = (bigNum: BigNumber, decimals = 18) => { @@ -77,10 +81,14 @@ const displayRate = (capacity: string, rate: string, symbol: string, decimals = } } -const TokenSearch: FunctionComponent = ({ tokens }) => { +const TokenSearch: FunctionComponent = ({ tokens, sourceChain }) => { const [searchTerm, setSearchTerm] = useState("") const [filteredTokens, setFilteredTokens] = useState(tokens) + const explorerUrl = getExplorer(sourceChain) + + if (!explorerUrl) throw Error(`Explorer url not found for ${sourceChain}`) + const handleInput = (event) => { const newSearchTerm = event.currentTarget.value.toLowerCase() setSearchTerm(newSearchTerm) @@ -136,7 +144,13 @@ const TokenSearch: FunctionComponent = ({ tokens }) => { filteredTokens.map((token) => ( - + + + + )} + +
{token.token}{token.address} + + {token.decimals} {token.poolMechanism} From a71beb0589550550c9671088d7518d0960f68b35 Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:05:49 -0500 Subject: [PATCH 3/7] Improve Search input & tooltip --- .../supported-networks/LaneConfig.astro | 82 +------- .../SimplePreactTooltip.tsx | 5 +- .../supported-networks/TokenSearch.tsx | 197 ++++++++++-------- 3 files changed, 109 insertions(+), 175 deletions(-) diff --git a/src/features/ccip/components/supported-networks/LaneConfig.astro b/src/features/ccip/components/supported-networks/LaneConfig.astro index aa0e7975614..db060c337c4 100644 --- a/src/features/ccip/components/supported-networks/LaneConfig.astro +++ b/src/features/ccip/components/supported-networks/LaneConfig.astro @@ -50,7 +50,7 @@ const display = (bigNum: string, decimals: number = 18) => { return utils.commify(numberWithoutDecimals) } -export const formatTime = (seconds: number) => { +const formatTime = (seconds: number) => { const minute = 60 const hour = 3600 // 60*60 @@ -165,8 +165,6 @@ if (supportedTokens) { .filter((item): item is TokenExtraInfo => item !== null && item.token !== undefined) .sort((itemA, itemB) => itemA.token.localeCompare(itemB.token, undefined, { sensitivity: "base" })) } - -// const filteredTokens = tokensWithExtraInfo --- @@ -246,84 +244,6 @@ if (supportedTokens) { Transferable tokens

- {/*
-
- - - - - - - - - - - - {filteredTokens.map((token) => { - return ( - - - - - - - - - ) - })} - -
SymbolToken AddressDecimals - - - - - -
{token.token} -
-
{token.decimals}{token.poolMechanism} - {token.rateLimiterConfig?.isEnabled - ? display(token.rateLimiterConfig.capacity, token.decimals) + " " + token.token - : "N/A"} - - {token.rateLimiterConfig?.isEnabled - ? (() => { - const { rateSecond, maxThroughput } = displayRate( - token.rateLimiterConfig.capacity, - token.rateLimiterConfig.rate, - token.token, - token.decimals - ) - - return ( - - ) - })() - : "N/A"} -
- */} ) : ( diff --git a/src/features/ccip/components/supported-networks/SimplePreactTooltip.tsx b/src/features/ccip/components/supported-networks/SimplePreactTooltip.tsx index b1cea277fc1..8a550f7d979 100644 --- a/src/features/ccip/components/supported-networks/SimplePreactTooltip.tsx +++ b/src/features/ccip/components/supported-networks/SimplePreactTooltip.tsx @@ -31,9 +31,7 @@ export const SimplePreactTooltip = ({ color: "var(--color-text-secondary)", padding: "8px 12px", borderRadius: "4px", - bottom: "110%", - left: "50%", - transform: "translateX(-50%) translateY(0)", + right: "20%", whiteSpace: "normal", display: isVisible ? "block" : "none", fontSize: "12px", @@ -41,6 +39,7 @@ export const SimplePreactTooltip = ({ maxWidth: "200px", textAlign: "center", boxShadow: "0 2px 4px rgba(0,0,0,0.2)", + zIndex: "1000", ...tooltipStyle, } diff --git a/src/features/ccip/components/supported-networks/TokenSearch.tsx b/src/features/ccip/components/supported-networks/TokenSearch.tsx index ce2c21a7b87..fc47ae9f6bc 100644 --- a/src/features/ccip/components/supported-networks/TokenSearch.tsx +++ b/src/features/ccip/components/supported-networks/TokenSearch.tsx @@ -98,100 +98,115 @@ const TokenSearch: FunctionComponent = ({ tokens, sourceChain return ( <> - -
-
- - - - - - - - - - - - - {filteredTokens.length > 0 ? ( - filteredTokens.map((token) => ( - - - - - - - - - )) - ) : ( + + +
+
SymbolToken AddressDecimals -
- -
-
-
- -
-
-
- -
-
{token.token} - - {token.decimals}{token.poolMechanism} - {token.rateLimiterConfig?.isEnabled - ? display(token.rateLimiterConfig.capacity, token.decimals) + " " + token.token - : "N/A"} - - {token.rateLimiterConfig?.isEnabled - ? (() => { - const { rateSecond, maxThroughput } = displayRate( - token.rateLimiterConfig.capacity, - token.rateLimiterConfig.rate, - token.token, - token.decimals - ) - return ( -
- -
- ) - })() - : "N/A"} -
+ + + + + + + + + + + + {filteredTokens.length > 0 ? ( + filteredTokens.map((token) => ( - + + + + + - )} - -
SymbolToken AddressDecimals +
+ +
+
+
+ +
+
+
+ +
+
- No token found + {token.token} + + {token.decimals}{token.poolMechanism} + {token.rateLimiterConfig?.isEnabled + ? display(token.rateLimiterConfig.capacity, token.decimals) + " " + token.token + : "N/A"} + + {token.rateLimiterConfig?.isEnabled + ? (() => { + const { rateSecond, maxThroughput } = displayRate( + token.rateLimiterConfig.capacity, + token.rateLimiterConfig.rate, + token.token, + token.decimals + ) + return ( +
+ +
+ ) + })() + : "N/A"}
-
+ )) + ) : ( +
+ No token found +
) From f89b8cc23fbcfbb4052de7b7d50bde16a3a7b2b2 Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:49:09 -0500 Subject: [PATCH 4/7] Fix max table height & allow vertical scrolling --- .../components/supported-networks/SimplePreactTooltip.tsx | 2 +- .../ccip/components/supported-networks/TokenSearch.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/features/ccip/components/supported-networks/SimplePreactTooltip.tsx b/src/features/ccip/components/supported-networks/SimplePreactTooltip.tsx index 8a550f7d979..1c7c5993d07 100644 --- a/src/features/ccip/components/supported-networks/SimplePreactTooltip.tsx +++ b/src/features/ccip/components/supported-networks/SimplePreactTooltip.tsx @@ -22,7 +22,7 @@ export const SimplePreactTooltip = ({ width: "0.8em", height: "0.8em", marginLeft: "2px", - marginRight: "5px", + marginRight: "4px", } const defaultTooltipStyle = { diff --git a/src/features/ccip/components/supported-networks/TokenSearch.tsx b/src/features/ccip/components/supported-networks/TokenSearch.tsx index fc47ae9f6bc..33166c758a8 100644 --- a/src/features/ccip/components/supported-networks/TokenSearch.tsx +++ b/src/features/ccip/components/supported-networks/TokenSearch.tsx @@ -116,8 +116,8 @@ const TokenSearch: FunctionComponent = ({ tokens, sourceChain }} /> -
- +
+
From f5d875b2632d15c45eea675b7b47cde01341aa66 Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:54:16 -0500 Subject: [PATCH 5/7] Add sticky thead --- src/features/ccip/components/supported-networks/TokenSearch.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/ccip/components/supported-networks/TokenSearch.tsx b/src/features/ccip/components/supported-networks/TokenSearch.tsx index 33166c758a8..72d7443bbf3 100644 --- a/src/features/ccip/components/supported-networks/TokenSearch.tsx +++ b/src/features/ccip/components/supported-networks/TokenSearch.tsx @@ -118,7 +118,7 @@ const TokenSearch: FunctionComponent = ({ tokens, sourceChain
Symbol
- + From 524e6c1b53a690c0c30407e51965704097d1e403 Mon Sep 17 00:00:00 2001 From: aelmanaa Date: Fri, 7 Jun 2024 09:46:56 +0200 Subject: [PATCH 6/7] reuse existing components --- .../SimplePreactAddress.tsx | 53 ------------------- .../supported-networks/TokenSearch.tsx | 10 ++-- .../Tooltip}/SimplePreactTooltip.tsx | 0 src/features/common/Tooltip/index.ts | 1 + 4 files changed, 6 insertions(+), 58 deletions(-) delete mode 100644 src/features/ccip/components/supported-networks/SimplePreactAddress.tsx rename src/features/{ccip/components/supported-networks => common/Tooltip}/SimplePreactTooltip.tsx (100%) diff --git a/src/features/ccip/components/supported-networks/SimplePreactAddress.tsx b/src/features/ccip/components/supported-networks/SimplePreactAddress.tsx deleted file mode 100644 index eeb56535497..00000000000 --- a/src/features/ccip/components/supported-networks/SimplePreactAddress.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/** @jsxImportSource preact */ -import { useState } from "preact/hooks" - -export const SimplePreactAddress = ({ contractUrl, address, endLength = 6, urlClass = "", urlId = "" }) => { - address = address || contractUrl.split("/").pop() - const [isCopied, setIsCopied] = useState(false) - - const containerStyle = { - display: "inline-flex", - alignItems: "center", - gap: "--space-1x", - wordBreak: "break-word", - } - - const linkStyle = { - background: "#f0f0f0", - padding: "1px 5px", - borderRadius: "5px", - wordBreak: "break-word", - } - - const buttonStyle = { - background: "none", - border: "none", - cursor: "pointer", - height: "16px", - width: "16px", - minWidth: "12px", - } - - const formattedAddress = - endLength && address ? `${address.slice(0, endLength + 2)}...${address.slice(-endLength)}` : address - - const handleCopy = async () => { - await navigator.clipboard.writeText(address) - setIsCopied(true) - setTimeout(() => setIsCopied(false), 2000) - } - - return ( - - - {formattedAddress} - - - - ) -} diff --git a/src/features/ccip/components/supported-networks/TokenSearch.tsx b/src/features/ccip/components/supported-networks/TokenSearch.tsx index 72d7443bbf3..14f1e5b1723 100644 --- a/src/features/ccip/components/supported-networks/TokenSearch.tsx +++ b/src/features/ccip/components/supported-networks/TokenSearch.tsx @@ -1,12 +1,12 @@ /** @jsxImportSource preact */ import { useState } from "preact/hooks" -import { FunctionComponent } from "preact" +import { h, FunctionComponent } from "preact" import BigNumber from "bignumber.js" import { utils } from "ethers" import { SupportedChain } from "@config" import { getExplorer, getExplorerAddressUrl } from "@features/utils" -import { SimplePreactAddress } from "./SimplePreactAddress" -import { SimplePreactTooltip } from "./SimplePreactTooltip" +import Address from "@components/Address" +import { SimplePreactTooltip } from "@features/common/Tooltip" interface TokenExtraInfo { token: string @@ -89,7 +89,7 @@ const TokenSearch: FunctionComponent = ({ tokens, sourceChain if (!explorerUrl) throw Error(`Explorer url not found for ${sourceChain}`) - const handleInput = (event) => { + const handleInput = (event: h.JSX.TargetedEvent) => { const newSearchTerm = event.currentTarget.value.toLowerCase() setSearchTerm(newSearchTerm) const newFilteredTokens = tokens.filter((token) => token.token.toLowerCase().includes(newSearchTerm)) @@ -161,7 +161,7 @@ const TokenSearch: FunctionComponent = ({ tokens, sourceChain
Symbol Token Address
{token.token} - Date: Fri, 7 Jun 2024 09:59:20 +0200 Subject: [PATCH 7/7] nit --- src/features/ccip/components/supported-networks/TokenSearch.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/ccip/components/supported-networks/TokenSearch.tsx b/src/features/ccip/components/supported-networks/TokenSearch.tsx index 14f1e5b1723..8a152facde3 100644 --- a/src/features/ccip/components/supported-networks/TokenSearch.tsx +++ b/src/features/ccip/components/supported-networks/TokenSearch.tsx @@ -76,7 +76,7 @@ const displayRate = (capacity: string, rate: string, symbol: string, decimals = const displayTime = `${formatTime(totalRefillTime)}` return { - rateSecond: `${rateNormalized} ${symbol}/second`, + rateSecond: `${utils.commify(rateNormalized)} ${symbol}/second`, maxThroughput: `Refills from 0 to ${utils.commify(capacityNormalized)} ${symbol} in ${displayTime}`, } }