@@ -161,7 +143,7 @@ export default function RPCList({ chain, lang }) {
}
const Shimmer = () => {
- return
;
};
function PrivacyIcon({ tracking, isOpenSource = false }) {
@@ -181,13 +163,12 @@ function PrivacyIcon({ tracking, isOpenSource = false }) {
return
;
}
-const Row = ({ values, chain, isEthMainnet, privacy, lang, className }) => {
+const Row = ({ values, chain, privacy, lang, className }) => {
const t = useTranslations("Common", lang);
const { data, isLoading, refetch } = values;
const rpcs = useRpcStore((state) => state.rpcs);
const addRpc = useRpcStore((state) => state.addRpc);
- const account = useAccount((state) => state.account);
useEffect(() => {
// ignore first request to a url and refetch to calculate latency which doesn't include DNS lookup
@@ -205,8 +186,8 @@ const Row = ({ values, chain, isEthMainnet, privacy, lang, className }) => {
return (
-
- {isLoading ? : data?.url}
+ |
+ {isLoading ? : data?.url ? : null}
|
{isLoading ? : data?.height} |
{isLoading ? : data?.latency} |
@@ -225,27 +206,23 @@ const Row = ({ values, chain, isEthMainnet, privacy, lang, className }) => {
>
)}
-
-
- {isLoading ? : }
-
- |
+
+
+ {isLoading ? : }
+
+ |
{isLoading ? (
) : (
<>
- {isEthMainnet ? (
-
- ) : (
- !data.disableConnect && (
-
- )
+ {!data.disableConnect && (
+
)}
>
)}
@@ -254,32 +231,11 @@ const Row = ({ values, chain, isEthMainnet, privacy, lang, className }) => {
);
};
-const CopyUrl = ({ url = "" }) => {
- const { hasCopied, onCopy } = useClipboard()
-
- const handleCopy = () => {
- if (url.includes("eth.llamarpc")) {
- Fathom.trackGoal(FATHOM_DROPDOWN_EVENTS_ID[1], 0);
- }
-
- return onCopy(url)
- }
-
- return (
-
- );
-};
-
const EmptyIcon = () => (
-)
+);
const RedIcon = () => (
);
+
+const CopyUrl = ({ url }) => {
+ const [open, setOpen] = useState(false);
+
+ useEffect(() => {
+ if (open) {
+ setTimeout(() => {
+ setOpen(false);
+ }, 500);
+ }
+ }, [open]);
+
+ const popover = usePopoverStore({ placement: "bottom", open });
+
+ return (
+ <>
+ {
+ navigator.clipboard.writeText(url).then(
+ () => {
+ setOpen(true);
+ if (url.includes("eth.llamarpc")) {
+ Fathom.trackGoal(FATHOM_DROPDOWN_EVENTS_ID[1], 0);
+ }
+ },
+ () => {
+ console.error(`Failed to copy ${url}`);
+ },
+ );
+ }}
+ >
+ {url}
+
+ }
+ />
+ {popover.show ? (
+
+ Copied!
+
+ ) : null}
+ >
+ );
+};
diff --git a/components/Tooltip/index.js b/components/Tooltip/index.js
index ea6d31040a..ee290b6951 100755
--- a/components/Tooltip/index.js
+++ b/components/Tooltip/index.js
@@ -1,25 +1,34 @@
-import { Tooltip as AriaTooltip, TooltipAnchor, useTooltipState } from 'ariakit/tooltip';
+import Linkify from "react-linkify";
+import { Tooltip as AriaTooltip, TooltipAnchor, useTooltipStore } from "@ariakit/react/tooltip";
export const Tooltip = ({ children, content, ...props }) => {
- const tooltip = useTooltipState({ placement: 'bottom' });
+ const tooltip = useTooltipStore({ placement: "bottom", showTimeout: 100 });
if (!content) return {children};
return (
<>
{children}
- {content}
+ (
+
+ {decoratedText}
+
+ )}
+ >
+ {content}
+
>
);
diff --git a/components/chain/index.js b/components/chain/index.js
index 10701ca9af..2cc1578267 100644
--- a/components/chain/index.js
+++ b/components/chain/index.js
@@ -44,7 +44,7 @@ export default function Chain({ chain, buttonOnly, lang }) {
if (buttonOnly) {
return (
|