diff --git a/src/AddressTransactions.tsx b/src/AddressTransactions.tsx index 762356f..b7985fa 100644 --- a/src/AddressTransactions.tsx +++ b/src/AddressTransactions.tsx @@ -36,6 +36,7 @@ const AddressTransactions: React.FC = () => { const [checksummedAddress, setChecksummedAddress] = useState(); const [isENS, setENS] = useState(); + const [error, setError] = useState(); // If it looks like it is an ENS name, try to resolve it useEffect(() => { @@ -50,6 +51,9 @@ const AddressTransactions: React.FC = () => { if (resolvedAddress !== null) { setENS(true); setChecksummedAddress(resolvedAddress); + setError(false); + } else { + setError(true); } }; resolveName(); @@ -129,82 +133,88 @@ const AddressTransactions: React.FC = () => { const [feeDisplay, feeDisplayToggler] = useFeeToggler(); - if (!checksummedAddress) { - return <>; - } - return ( - -
- - Address - - {checksummedAddress} - - - {isENS && ( - - ENS: {params.addressOrName} - - )} -
-
- -
-
- {page === undefined ? ( - <>Waiting for search results... - ) : ( - <>{page.length} transactions on this page - )} -
- -
- - {controller ? ( + {error ? ( + + "{params.addressOrName}" is not an ETH address or ENS name. + + ) : ( + checksummedAddress && ( <> - {controller.getPage().map((tx) => ( - - ))} -
-
- {page !== undefined && ( - <>{page.length} transactions on this page + +
+ + Address + + {checksummedAddress} + + + {isENS && ( + + ENS: {params.addressOrName} + )}
- + +
+
+ {page === undefined ? ( + <>Waiting for search results... + ) : ( + <>{page.length} transactions on this page + )} +
+ +
+ -
+ {controller ? ( + <> + {controller.getPage().map((tx) => ( + + ))} +
+
+ {page !== undefined && ( + <>{page.length} transactions on this page + )} +
+ +
+ + ) : ( + + )} + - ) : ( - - )} - + ) + )} ); };