@@ -11,13 +11,6 @@ import {
11
11
FormMessage ,
12
12
} from "@/components/ui/form" ;
13
13
import { Input } from "@/components/ui/input" ;
14
- import {
15
- Select ,
16
- SelectContent ,
17
- SelectItem ,
18
- SelectTrigger ,
19
- SelectValue ,
20
- } from "@/components/ui/select" ;
21
14
import { Textarea } from "@/components/ui/textarea" ;
22
15
import { useThirdwebClient } from "@/constants/thirdweb.client" ;
23
16
import { useQueryClient } from "@tanstack/react-query" ;
@@ -305,97 +298,46 @@ export function FilterDetailsStep({
305
298
{ watchFilterType === "event" &&
306
299
Object . keys ( fetchedAbis ) . length > 0 &&
307
300
eventSignatures . length > 0 ? (
308
- < Select
301
+ < select
302
+ className = "h-10 w-full rounded-md border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50"
309
303
value = { field . value }
310
- onValueChange = { ( value ) => {
311
- field . onChange ( value ) ;
312
- // Find the selected event
304
+ onChange = { ( e ) => {
305
+ field . onChange ( e . target . value ) ;
313
306
const selectedEvent = eventSignatures . find (
314
- ( sig ) => sig . signature === value ,
307
+ ( sig ) => sig . signature === e . target . value ,
315
308
) ;
316
- // Set the ABI for the event
317
309
form . setValue ( "sigHashAbi" , selectedEvent ?. abi || "" ) ;
318
310
} }
319
311
>
320
- < SelectTrigger >
321
- < SelectValue placeholder = "Select an event signature" >
322
- { field . value
323
- ? eventSignatures . find (
324
- ( sig ) => sig . signature === field . value ,
325
- ) ?. name || ""
326
- : null }
327
- </ SelectValue >
328
- </ SelectTrigger >
329
- < SelectContent className = "max-h-60 overflow-y-auto" >
330
- { eventSignatures . map ( ( event ) => {
331
- // Truncate the hash for display purposes
332
- const truncatedHash = truncateMiddle (
333
- event . signature ,
334
- 6 ,
335
- 4 ,
336
- ) ;
337
-
338
- return (
339
- < SelectItem
340
- key = { event . signature }
341
- value = { event . signature }
342
- title = { event . name }
343
- >
344
- < div className = "flex flex-col" >
345
- < span className = "font-medium" > { event . name } </ span >
346
- < span className = "text-muted-foreground text-xs" >
347
- Signature: { truncatedHash }
348
- </ span >
349
- </ div >
350
- </ SelectItem >
351
- ) ;
352
- } ) }
353
- </ SelectContent >
354
- </ Select >
312
+ < option value = "" > Select an event signature</ option >
313
+ { eventSignatures . map ( ( event ) => (
314
+ < option key = { event . signature } value = { event . signature } >
315
+ { event . name } (Signature:{ " " }
316
+ { truncateMiddle ( event . signature , 6 , 4 ) } )
317
+ </ option >
318
+ ) ) }
319
+ </ select >
355
320
) : watchFilterType === "transaction" &&
356
321
Object . keys ( fetchedTxAbis ) . length > 0 &&
357
322
functionSignatures . length > 0 ? (
358
- < Select
323
+ < select
324
+ className = "h-10 w-full rounded-md border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50"
359
325
value = { field . value }
360
- onValueChange = { ( value ) => {
361
- field . onChange ( value ) ;
362
- // Find the selected function
326
+ onChange = { ( e ) => {
327
+ field . onChange ( e . target . value ) ;
363
328
const selectedFunction = functionSignatures . find (
364
- ( sig ) => sig . signature === value ,
329
+ ( sig ) => sig . signature === e . target . value ,
365
330
) ;
366
- // Set the ABI for the function
367
331
form . setValue ( "sigHashAbi" , selectedFunction ?. abi || "" ) ;
368
332
} }
369
333
>
370
- < SelectTrigger className = "max-w-full" >
371
- < SelectValue placeholder = "Select a function signature" >
372
- { field . value
373
- ? functionSignatures . find (
374
- ( sig ) => sig . signature === field . value ,
375
- ) ?. name || ""
376
- : null }
377
- </ SelectValue >
378
- </ SelectTrigger >
379
- < SelectContent className = "max-h-60 max-w-[600px] overflow-y-auto" >
380
- { functionSignatures . map ( ( func ) => (
381
- < SelectItem
382
- key = { func . signature }
383
- value = { func . signature }
384
- title = { func . signature }
385
- className = "w-full overflow-x-auto"
386
- >
387
- < div className = "flex w-full flex-col" >
388
- < span className = "overflow-x-auto whitespace-nowrap pb-1 font-medium" >
389
- { func . name }
390
- </ span >
391
- < span className = "overflow-x-auto text-muted-foreground text-xs" >
392
- Selector: { func . signature }
393
- </ span >
394
- </ div >
395
- </ SelectItem >
396
- ) ) }
397
- </ SelectContent >
398
- </ Select >
334
+ < option value = "" > Select a function signature</ option >
335
+ { functionSignatures . map ( ( func ) => (
336
+ < option key = { func . signature } value = { func . signature } >
337
+ { func . name } (Selector: { func . signature } )
338
+ </ option >
339
+ ) ) }
340
+ </ select >
399
341
) : (
400
342
< Input
401
343
placeholder = {
0 commit comments