From 22f96ecf59a22e738f92413488028deca9fecc49 Mon Sep 17 00:00:00 2001 From: Jacob Frantz Date: Sun, 27 Feb 2022 18:04:06 -0500 Subject: [PATCH 1/2] Update index.tsx --- src/components/Body/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Body/index.tsx b/src/components/Body/index.tsx index 0ea77d3..7b4634a 100644 --- a/src/components/Body/index.tsx +++ b/src/components/Body/index.tsx @@ -81,12 +81,13 @@ const TD = ({ txt }: { txt: string }) => ( function Body() { const { colorMode } = useColorMode(); const bgColor = { light: "white", dark: "gray.700" }; + const addressFromURL = new URLSearchParams(window.location.search).get("address"); const toast = useToast(); const { onOpen, onClose, isOpen } = useDisclosure(); const { isOpen: tableIsOpen, onToggle: tableOnToggle } = useDisclosure(); const [provider, setProvider] = useState(); - const [showAddress, setShowAddress] = useState(""); // gets displayed in input. ENS name remains as it is + const [showAddress, setShowAddress] = useState(addressFromURL ?? ""); // gets displayed in input. ENS name remains as it is const [address, setAddress] = useState(""); // internal resolved address const [isAddressValid, setIsAddressValid] = useState(true); const [uri, setUri] = useState(""); From c3a7b11c39bc648ba5db3ab0f08bb20455824d3f Mon Sep 17 00:00:00 2001 From: Jacob Frantz Date: Mon, 28 Feb 2022 11:02:43 -0500 Subject: [PATCH 2/2] use url param in internal resolved `address` --- src/components/Body/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Body/index.tsx b/src/components/Body/index.tsx index 7b4634a..7cfb713 100644 --- a/src/components/Body/index.tsx +++ b/src/components/Body/index.tsx @@ -88,7 +88,7 @@ function Body() { const [provider, setProvider] = useState(); const [showAddress, setShowAddress] = useState(addressFromURL ?? ""); // gets displayed in input. ENS name remains as it is - const [address, setAddress] = useState(""); // internal resolved address + const [address, setAddress] = useState(addressFromURL ?? ""); // internal resolved address const [isAddressValid, setIsAddressValid] = useState(true); const [uri, setUri] = useState(""); const [networkIndex, setNetworkIndex] = useState(0);