|
|
@ -1,11 +1,12 @@ |
|
|
|
import { CopyToClipboard } from '@remix-ui/clipboard' |
|
|
|
import { CopyToClipboard } from '@remix-ui/clipboard' |
|
|
|
|
|
|
|
import { CustomTooltip } from '@remix-ui/helper' |
|
|
|
import { TreeView, TreeViewItem } from '@remix-ui/tree-view' |
|
|
|
import { TreeView, TreeViewItem } from '@remix-ui/tree-view' |
|
|
|
import React from 'react' |
|
|
|
import React from 'react' |
|
|
|
|
|
|
|
import { useIntl } from 'react-intl' |
|
|
|
|
|
|
|
|
|
|
|
export interface RemixUiCompileDetailsProps { |
|
|
|
export interface RemixUiCompileDetailsProps { |
|
|
|
plugin: any |
|
|
|
plugin: any |
|
|
|
contractProperties: any |
|
|
|
contractProperties: any |
|
|
|
intl: any |
|
|
|
|
|
|
|
selectedContract: string |
|
|
|
selectedContract: string |
|
|
|
help: any |
|
|
|
help: any |
|
|
|
insertValue: any |
|
|
|
insertValue: any |
|
|
@ -14,16 +15,20 @@ export interface RemixUiCompileDetailsProps { |
|
|
|
|
|
|
|
|
|
|
|
const _paq = (window._paq = window._paq || []) |
|
|
|
const _paq = (window._paq = window._paq || []) |
|
|
|
|
|
|
|
|
|
|
|
export function RemixUiCompileDetails({ plugin, contractProperties, intl, selectedContract, saveAs, help, insertValue }: RemixUiCompileDetailsProps) { |
|
|
|
export function RemixUiCompileDetails({ plugin, contractProperties, selectedContract, saveAs, help, insertValue }: RemixUiCompileDetailsProps) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const intl = useIntl() |
|
|
|
const downloadFn = () => { |
|
|
|
const downloadFn = () => { |
|
|
|
_paq.push(['trackEvent', 'compiler', 'compilerDetails', 'download']) |
|
|
|
_paq.push(['trackEvent', 'compiler', 'compilerDetails', 'download']) |
|
|
|
saveAs(new Blob([JSON.stringify(contractProperties, null, '\t')]), `${selectedContract}_compData.json`) |
|
|
|
saveAs(new Blob([JSON.stringify(contractProperties, null, '\t')]), `${selectedContract}_compData.json`) |
|
|
|
} |
|
|
|
} |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
<div> |
|
|
|
<div className="d-flex justify-content-between align-items-center mr-1"> |
|
|
|
<span>{selectedContract}</span><span>Download Compile details</span> |
|
|
|
<span className="lead">{selectedContract}</span> |
|
|
|
|
|
|
|
<CustomTooltip tooltipText={intl.formatMessage({id: 'solidity.compileDetails'})}> |
|
|
|
|
|
|
|
<span className="btn btn-outline-success border-success mr-1" onClick={downloadFn}>Download</span> |
|
|
|
|
|
|
|
</CustomTooltip> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="remixui_detailsJSON"> |
|
|
|
<div className="remixui_detailsJSON"> |
|
|
|
<TreeView> |
|
|
|
<TreeView> |
|
|
|