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" ;
2
2
import styled from "styled-components" ;
3
3
4
4
import { useAccount , useDisconnect } from "wagmi" ;
@@ -67,13 +67,30 @@ const UserContainer = styled.div`
67
67
gap: 12px;
68
68
` ;
69
69
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
+
70
82
export const DisconnectWalletButton : React . FC = ( ) => {
71
83
const { disconnect } = useDisconnect ( ) ;
72
84
return < Button text = { `Disconnect` } onClick = { ( ) => disconnect ( ) } /> ;
73
85
} ;
74
86
75
87
const 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
+
77
94
return (
78
95
< EnsureChainContainer >
79
96
< EnsureChain >
@@ -84,7 +101,9 @@ const General: React.FC = () => {
84
101
< IdenticonOrAvatar size = "48" />
85
102
</ StyledAvatarContainer >
86
103
< StyledAddressContainer >
87
- < AddressOrName />
104
+ < StyledA href = { addressExplorerLink } rel = "noreferrer" target = "_blank" >
105
+ < AddressOrName />
106
+ </ StyledA >
88
107
</ StyledAddressContainer >
89
108
< StyledChainContainer >
90
109
< ChainDisplay />
You can’t perform that action at this time.
0 commit comments