diff --git a/web/package.json b/web/package.json index 3f62f8d40..401252a84 100644 --- a/web/package.json +++ b/web/package.json @@ -72,6 +72,7 @@ "react-chartjs-2": "^4.3.1", "react-dom": "^18.2.0", "react-error-boundary": "^3.1.4", + "react-identicons": "^1.2.5", "react-is": "^18.2.0", "react-jazzicon": "^1.0.4", "react-loading-skeleton": "^3.2.0", diff --git a/web/src/components/ConnectButton.tsx b/web/src/components/ConnectButton.tsx index 86c9a765b..7ef37da99 100644 --- a/web/src/components/ConnectButton.tsx +++ b/web/src/components/ConnectButton.tsx @@ -7,17 +7,26 @@ import { useConnect } from "hooks/useConnect"; import { SUPPORTED_CHAINS } from "consts/chains"; const AccountDisplay: React.FC = () => { - const { account, chainId } = useWeb3(); - const chainName = chainId ? SUPPORTED_CHAINS[chainId].chainName : undefined; - const shortAddress = account ? shortenAddress(account) : undefined; return ( - {chainName} - + + ); }; +export const ChainDisplay: React.FC = () => { + const { chainId } = useWeb3(); + const chainName = chainId ? SUPPORTED_CHAINS[chainId].chainName : undefined; + return {chainName}; +}; + +export const AddressDisplay: React.FC = () => { + const { account } = useWeb3(); + const shortAddress = account ? shortenAddress(account) : undefined; + return ; +}; + const StyledContainer = styled.div` width: fit-content; height: 34px; @@ -42,11 +51,7 @@ const StyledContainer = styled.div` const ConnectButton: React.FC = () => { const { active } = useWeb3(); const { activate, connecting } = useConnect(); - return active ? ( - - ) : ( -