@@ -32,15 +32,13 @@ export function DonateToGitcoinDialog(props: Props) {
32
32
33
33
const selectedChain = chains . find ( ( c ) => c . id === chainId ) ;
34
34
35
- // Get the selected token details
36
35
const tokenDetails = selectedChain ?. tokens . find (
37
36
( t ) => t . address === selectedToken
38
37
) ;
39
38
40
39
const isNativeToken = selectedToken . toLowerCase ( ) === NATIVE . toLowerCase ( ) ;
41
40
const gitcoinAddress = "0x5645bF145C3f1E974D0D7FB91bf3c68592ab5012" ; // todo: Replace with actual Gitcoin address
42
41
43
- // For ERC20 transfers
44
42
const { data : simulateData } = useSimulateContract ( {
45
43
address : selectedToken as `0x${string } `,
46
44
abi : [
@@ -65,7 +63,6 @@ export function DonateToGitcoinDialog(props: Props) {
65
63
const { writeContract, isPending, data : writeHash } = useWriteContract ( ) ;
66
64
const { switchChain } = useSwitchChain ( ) ;
67
65
68
- // Add this hook to watch the transaction
69
66
const {
70
67
isSuccess : isTransactionSuccess ,
71
68
isError : isTransactionError ,
@@ -96,7 +93,6 @@ export function DonateToGitcoinDialog(props: Props) {
96
93
}
97
94
} ;
98
95
99
- // Update status based on transaction state
100
96
React . useEffect ( ( ) => {
101
97
if ( isTransactionSuccess && transactionReceipt ) {
102
98
setStatus ( "success" ) ;
@@ -114,7 +110,6 @@ export function DonateToGitcoinDialog(props: Props) {
114
110
} ;
115
111
116
112
const closeModal = ( ) => {
117
- // Reset all states
118
113
setSelectedToken ( "" ) ;
119
114
setAmount ( "" ) ;
120
115
setTxHash ( undefined ) ;
@@ -198,7 +193,6 @@ export function DonateToGitcoinDialog(props: Props) {
198
193
Donate to Gitcoin
199
194
</ Dialog . Title >
200
195
201
- { /* Chain Selection */ }
202
196
< div >
203
197
< label className = "block text-sm font-medium text-gray-700" >
204
198
Network
@@ -216,7 +210,6 @@ export function DonateToGitcoinDialog(props: Props) {
216
210
</ select >
217
211
</ div >
218
212
219
- { /* Token Selection */ }
220
213
< div >
221
214
< label className = "block text-sm font-medium text-gray-700" >
222
215
Token
@@ -237,7 +230,6 @@ export function DonateToGitcoinDialog(props: Props) {
237
230
</ select >
238
231
</ div >
239
232
240
- { /* Amount Input */ }
241
233
< div >
242
234
< label className = "block text-sm font-medium text-gray-700" >
243
235
Amount
@@ -251,7 +243,6 @@ export function DonateToGitcoinDialog(props: Props) {
251
243
/>
252
244
</ div >
253
245
254
- { /* Donate Button */ }
255
246
< Button
256
247
type = "button"
257
248
onClick = { handleDonate }
@@ -276,13 +267,10 @@ function DialogWrapper({
276
267
closeModal : ( ) => void ;
277
268
children : JSX . Element ;
278
269
} ) {
279
- // useAccount chainId
280
270
const { chainId } = useAccount ( ) ;
281
271
const chains = getChains ( ) ;
282
272
const selectedChain = chains . find ( ( c ) => c . id === chainId ) ;
283
273
284
- console . log ( selectedChain ) ;
285
-
286
274
return (
287
275
< Transition appear show = { isOpen } as = { Fragment } >
288
276
< Dialog as = "div" className = "relative z-10" onClose = { closeModal } >
0 commit comments