Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 10 additions & 2 deletions src/components/AddressReact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,22 @@ const AddressComponent = ({ contractUrl, address, endLength, urlClass, urlId }:

if (!address) return null

const handleClick = (e) => {
const handleClick = (e: React.MouseEvent) => {
e.preventDefault()
e.stopPropagation()
if (address) navigator.clipboard.writeText(address)
}

return (
<span className={`addressContainer ${urlClass || ""}`} id={urlId}>
<a title={address} className="addressLink" href={contractUrl} target="_blank" rel="noopener noreferrer">
<a
title={address}
className="addressLink"
href={contractUrl}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
>
{endLength && address ? address.slice(0, endLength + 2) + "..." + address.slice(-endLength) : address}
</a>
<button
Expand Down
70 changes: 39 additions & 31 deletions src/components/CCIP/Tables/ChainTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,40 +117,48 @@ function ChainTable({ lanes, explorer, sourceNetwork, environment }: TableProps)
?.filter((network) => network.name.toLowerCase().includes(search.toLowerCase()))
.slice(0, seeMore ? lanes.length : BEFORE_SEE_MORE)
.map((network, index) => (
<tr key={index}>
<td>
<button
type="button"
className="ccip-table__network-name"
onClick={() => {
const laneData = getLane({
sourceChain: sourceNetwork.key as SupportedChain,
destinationChain: network.key as SupportedChain,
environment,
version: Version.V1_2_0,
})
<tr
key={index}
className="ccip-table__row--clickable"
onClick={() => {
const laneData = getLane({
sourceChain: sourceNetwork.key as SupportedChain,
destinationChain: network.key as SupportedChain,
environment,
version: Version.V1_2_0,
})

drawerWidthStore.set(DrawerWidth.Wide)
drawerContentStore.set(() => (
<LaneDrawer
environment={environment}
lane={laneData}
sourceNetwork={sourceNetwork}
destinationNetwork={{
name: network?.name || "",
logo: network?.logo || "",
key: network.key,
}}
inOutbound={inOutbound}
explorer={explorer}
/>
))
}}
aria-label={`View lane details for ${network.name}`}
>
drawerWidthStore.set(DrawerWidth.Wide)
drawerContentStore.set(() => (
<LaneDrawer
environment={environment}
lane={laneData}
sourceNetwork={sourceNetwork}
destinationNetwork={{
name: network?.name || "",
logo: network?.logo || "",
key: network.key,
}}
inOutbound={inOutbound}
explorer={explorer}
/>
))
}}
role="button"
tabIndex={0}
aria-label={`View lane details for ${network.name}`}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault()
e.currentTarget.click()
}
}}
>
<td>
<span className="ccip-table__network-name">
<img src={network.logo} alt={`${network.name} blockchain logo`} className="ccip-table__logo" />
{network.name}
</button>
</span>
</td>
<td
style={{ textAlign: "right" }}
Expand Down
4 changes: 4 additions & 0 deletions src/components/CCIP/Tables/Table.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
background-color: var(--gray-50);
}

.ccip-table__row--clickable {
cursor: pointer;
}

.ccip-table thead th {
/* Body/Body Semi S */
font-family: "Inter";
Expand Down
42 changes: 26 additions & 16 deletions src/components/CCIP/Tables/TokenChainsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,33 @@ function TokenChainsTable({ networks, token, lanes, environment }: TableProps) {
const allLanesPaused = areAllLanesPaused(network.tokenDecimals, lanes[network.key] || {})

return (
<tr key={index} className={allLanesPaused ? "ccip-table__row--paused" : ""}>
<tr
key={index}
className={`ccip-table__row--clickable ${allLanesPaused ? "ccip-table__row--paused" : ""}`}
onClick={() => {
drawerWidthStore.set(DrawerWidth.Wide)
drawerContentStore.set(() => (
<TokenDrawer
token={token}
network={network}
environment={environment}
poolTypesByChain={poolTypesByChain}
/>
))
}}
role="button"
tabIndex={0}
aria-label={`View ${network.name} token details`}
onKeyDown={(e) => {
if (e.key === "Enter" || e.key === " ") {
e.preventDefault()
e.currentTarget.click()
}
}}
>
<td>
<button
type="button"
<span
className={`ccip-table__network-name ${allLanesPaused ? "ccip-table__network-name--paused" : ""}`}
onClick={() => {
drawerWidthStore.set(DrawerWidth.Wide)
drawerContentStore.set(() => (
<TokenDrawer
token={token}
network={network}
environment={environment}
poolTypesByChain={poolTypesByChain}
/>
))
}}
aria-label={`View ${network.name} token details`}
>
<span className="ccip-table__logoContainer">
<img
Expand Down Expand Up @@ -136,7 +146,7 @@ function TokenChainsTable({ networks, token, lanes, environment }: TableProps) {
⏸️
</span>
)}
</button>
</span>
</td>
<td>{network.tokenName}</td>
<td>{network.tokenSymbol}</td>
Expand Down
Loading