Merge branch 'master' of https://github.com/ethereum/remix-project into editorcontext

editorcontextDummy
filip mertens 2 years ago
commit b3170170e1
  1. 16
      libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx

@ -57,10 +57,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
content: currentFile
})
enableAtAddress(true)
} else if (/.(.sol)$/.exec(currentFile) ||
/.(.vy)$/.exec(currentFile) || // vyper
/.(.lex)$/.exec(currentFile) || // lexon
/.(.contract)$/.exec(currentFile)) {
} else if (isContractFile(currentFile)) {
setAbiLabel({
display: 'none',
content: ''
@ -115,6 +112,13 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
}
}
const isContractFile = (file) => {
return /.(.sol)$/.exec(file) ||
/.(.vy)$/.exec(file) || // vyper
/.(.lex)$/.exec(file) || // lexon
/.(.contract)$/.exec(file)
}
const enableAtAddress = (enable: boolean) => {
if (enable) {
setAtAddressOptions({
@ -214,7 +218,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
<div className="udapp_container" data-id="contractDropdownContainer">
<label className="udapp_settingsLabel">Contract</label>
<div className="udapp_subcontainer">
<select ref={contractsRef} value={currentContract} onChange={handleContractChange} className="udapp_contractNames custom-select" disabled={contractOptions.disabled} title={contractOptions.title} style={{ display: loadType === 'abi' ? 'none' : 'block' }}>
<select ref={contractsRef} value={currentContract} onChange={handleContractChange} className="udapp_contractNames custom-select" disabled={contractOptions.disabled} title={contractOptions.title} style={{ display: loadType === 'abi' && !isContractFile(currentFile) ? 'none' : 'block' }}>
{ (contractList[currentFile] || []).map((contract, index) => {
return <option key={index} value={contract.alias}>{contract.alias} - {contract.file}</option>
}) }
@ -258,7 +262,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
</div> : ''
}
</div>
<div className="udapp_orLabel mt-2" style={{ display: loadType === 'abi' ? 'none' : 'block' }}>or</div>
<div className="udapp_orLabel mt-2" style={{ display: loadType === 'abi' && !isContractFile(currentFile) ? 'none' : 'block' }}>or</div>
<div className="udapp_button udapp_atAddressSect">
<button className="udapp_atAddress btn btn-sm btn-info" id="runAndDeployAtAdressButton" disabled={atAddressOptions.disabled} title={atAddressOptions.title} onClick={loadFromAddress}>At Address</button>
<input

Loading…
Cancel
Save