@@ -43,29 +43,24 @@ export const ContractDropdown: React.FC<ContractDropdownProps> = ({ label, id, s
43
43
return (
44
44
< div className = "form-group" >
45
45
< label htmlFor = { id } > { label } </ label >
46
- < select value = { selectedContract ? JSON . stringify ( selectedContract ) : '' } className = { `form-control custom-select pr-4 ${ ! hasContracts ? 'disabled-cursor' : '' } ` } id = { id } disabled = { ! hasContracts } onChange = { handleSelectContract } >
46
+ < select value = { selectedContract ? JSON . stringify ( selectedContract ) : '' } className = { `form-control custom-select pr-4 ${ ! hasContracts ? 'disabled-cursor' : '' } ${ ! hasContracts ? 'text-muted' : '' } ` } id = { id } disabled = { ! hasContracts } onChange = { handleSelectContract } >
47
47
{ hasContracts ? (
48
48
Object . keys ( compilationOutput ) . map ( ( compilationTriggerFileName ) => (
49
- < optgroup key = { compilationTriggerFileName } label = { `[Compilation Trigger File]: ${ compilationTriggerFileName } ` } >
50
- { Object . keys ( compilationOutput [ compilationTriggerFileName ] . data . contracts ) . map ( ( fileName ) => (
51
- < Fragment key = { `${ compilationTriggerFileName } :${ fileName } ` } >
52
- < option disabled value = { `${ compilationTriggerFileName } :${ fileName } ` } style = { { fontWeight : 'bold' } } >
53
- [File]: { fileName }
54
- </ option >
55
- { Object . keys ( compilationOutput [ compilationTriggerFileName ] . data . contracts [ fileName ] ) . map ( ( contractName ) => {
56
- const value = JSON . stringify ( { triggerFilePath : compilationTriggerFileName , filePath : fileName , contractName : contractName } )
57
- return (
58
- < option key = { `${ compilationTriggerFileName } :${ fileName } :${ contractName } ` } value = { value } >
59
- { '\u00A0\u00A0\u00A0' + contractName } { /* Indentation for contract names */ }
60
- </ option >
61
- )
62
- } ) }
63
- </ Fragment >
64
- ) ) }
49
+ < optgroup key = { compilationTriggerFileName } label = { `Compilation trigger: ${ compilationTriggerFileName } ` } >
50
+ { Object . keys ( compilationOutput [ compilationTriggerFileName ] . data . contracts ) . map ( ( fileName ) => {
51
+ return Object . keys ( compilationOutput [ compilationTriggerFileName ] . data . contracts [ fileName ] ) . map ( ( contractName ) => {
52
+ const value = JSON . stringify ( { triggerFilePath : compilationTriggerFileName , filePath : fileName , contractName : contractName } )
53
+ return (
54
+ < option key = { `${ compilationTriggerFileName } :${ fileName } :${ contractName } ` } value = { value } >
55
+ { contractName } - { fileName }
56
+ </ option >
57
+ )
58
+ } )
59
+ } ) }
65
60
</ optgroup >
66
61
) )
67
62
) : (
68
- < option > No Compiled Contracts. Please compile and select a contract</ option >
63
+ < option > Compiled contract required </ option >
69
64
) }
70
65
</ select >
71
66
</ div >
0 commit comments