File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/components/ConnectWalletModal Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import ErrorView from './ErrorView'
7
7
import AccountView from './AccountView'
8
8
import TermsView from './TermsView'
9
9
import AppContext from '../../context'
10
+ import { Transaction } from '../../types'
11
+ import { getChainExplorerUrl } from '../../utils'
10
12
11
13
12
14
interface ConnectWalletModalProps {
@@ -22,6 +24,7 @@ export default function ConnectWalletModal (props: ConnectWalletModalProps) {
22
24
setSelectedAccount,
23
25
connectedTo,
24
26
setConnectedTo,
27
+ transactions,
25
28
metamask
26
29
} = useContext ( AppContext )
27
30
@@ -115,6 +118,13 @@ export default function ConnectWalletModal (props: ConnectWalletModalProps) {
115
118
setIsActionable ( true )
116
119
}
117
120
121
+ const handleTransactionClick = ( transaction : Transaction ) => {
122
+ const baseUrl = getChainExplorerUrl ( transaction . chainId )
123
+ if ( baseUrl ) {
124
+ window . open ( `${ baseUrl } /tx/${ transaction . hash } ` )
125
+ }
126
+ }
127
+
118
128
return (
119
129
< Dialog
120
130
open = { props . open }
@@ -140,6 +150,8 @@ export default function ConnectWalletModal (props: ConnectWalletModalProps) {
140
150
{ isAccountView && selectedAccount ? (
141
151
< AccountView
142
152
address = { selectedAccount }
153
+ transactions = { transactions }
154
+ onTransactionClick = { handleTransactionClick }
143
155
onDisconnect = { handleDisconnectWallet }
144
156
onChange = { handleChangeWallet }
145
157
/>
You can’t perform that action at this time.
0 commit comments