File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change 1- import React from "react" ;
1+ import React , { useMemo } from "react" ;
22import styled from "styled-components" ;
33
44import { useAccount , useDisconnect } from "wagmi" ;
@@ -67,13 +67,30 @@ const UserContainer = styled.div`
6767 gap: 12px;
6868` ;
6969
70+ const StyledA = styled . a `
71+ text-decoration: none;
72+ label {
73+ cursor: pointer;
74+ color: ${ ( { theme } ) => theme . primaryBlue } ;
75+ }
76+
77+ :hover {
78+ text-decoration: underline;
79+ }
80+ ` ;
81+
7082export const DisconnectWalletButton : React . FC = ( ) => {
7183 const { disconnect } = useDisconnect ( ) ;
7284 return < Button text = { `Disconnect` } onClick = { ( ) => disconnect ( ) } /> ;
7385} ;
7486
7587const General : React . FC = ( ) => {
76- const { address } = useAccount ( ) ;
88+ const { address, chain } = useAccount ( ) ;
89+
90+ const addressExplorerLink = useMemo ( ( ) => {
91+ return `${ chain ?. blockExplorers ?. default . url } /address/${ address } ` ;
92+ } , [ address , chain ] ) ;
93+
7794 return (
7895 < EnsureChainContainer >
7996 < EnsureChain >
@@ -84,7 +101,9 @@ const General: React.FC = () => {
84101 < IdenticonOrAvatar size = "48" />
85102 </ StyledAvatarContainer >
86103 < StyledAddressContainer >
87- < AddressOrName />
104+ < StyledA href = { addressExplorerLink } rel = "noreferrer" target = "_blank" >
105+ < AddressOrName />
106+ </ StyledA >
88107 </ StyledAddressContainer >
89108 < StyledChainContainer >
90109 < ChainDisplay />
You can’t perform that action at this time.
0 commit comments