fix absent downward caret. add type for contractpropertyName

pull/4167/head
Joseph Izang 1 year ago
parent 6b123c157c
commit f51cd80849
  1. 8
      libs/remix-ui/solidity-compile-details/src/lib/solidity-compile-details.tsx

@ -13,6 +13,10 @@ export interface RemixUiCompileDetailsProps {
saveAs: any saveAs: any
} }
export type ContractPropertyName = 'compilerInput' | 'name' | 'metadata' | 'bytecode' | 'abi' | 'storageLayout'
| 'web3Deploy' | 'metadataHash' | 'functionHashes' | 'gasEstimates' | 'devdoc' | 'userdoc' | 'Runtime Bytecode'
| 'Assembly'
const _paq = (window._paq = window._paq || []) const _paq = (window._paq = window._paq || [])
export function RemixUiCompileDetails({ plugin, contractProperties, selectedContract, saveAs, help, insertValue }: RemixUiCompileDetailsProps) { export function RemixUiCompileDetails({ plugin, contractProperties, selectedContract, saveAs, help, insertValue }: RemixUiCompileDetailsProps) {
@ -32,7 +36,7 @@ export function RemixUiCompileDetails({ plugin, contractProperties, selectedCont
</div> </div>
<div className="remixui_detailsJSON"> <div className="remixui_detailsJSON">
<TreeView> <TreeView>
{Object.keys(contractProperties).map((propertyName, index) => { {Object.keys(contractProperties).map((propertyName: ContractPropertyName, index) => {
const copyDetails = ( const copyDetails = (
<span className="remixui_copyDetails"> <span className="remixui_copyDetails">
<CopyToClipboard tip={intl.formatMessage({id: 'solidity.copy'})} content={contractProperties[propertyName]} direction="top" /> <CopyToClipboard tip={intl.formatMessage({id: 'solidity.copy'})} content={contractProperties[propertyName]} direction="top" />
@ -59,6 +63,8 @@ export function RemixUiCompileDetails({ plugin, contractProperties, selectedCont
{propertyName} {copyDetails} {questionMark} {propertyName} {copyDetails} {questionMark}
</div> </div>
} }
expand={propertyName === 'metadata' || propertyName === 'bytecode' ? true : false}
iconY='fas fa-caret-down'
> >
{insertValue(contractProperties, propertyName)} {insertValue(contractProperties, propertyName)}
</TreeViewItem> </TreeViewItem>

Loading…
Cancel
Save