add tooltip to download button.

pull/5370/head
Joseph Izang 1 year ago
parent 0d0ab68961
commit cc78bff052
  1. 2
      apps/remix-ide/src/app/plugins/compile-details.tsx
  2. 1
      apps/remix-ide/src/app/tabs/locales/en/solidity.json
  3. 2
      apps/remix-ide/src/remixAppManager.js
  4. 13
      libs/remix-ui/solidity-compile-details/src/lib/solidity-compile-details.tsx
  5. 1
      libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx

@ -27,7 +27,6 @@ export class CompilationDetailsPlugin extends ViewPlugin {
this.element.setAttribute('id', 'compileDetails') this.element.setAttribute('id', 'compileDetails')
this.payload = { this.payload = {
contractProperties: {} as any, contractProperties: {} as any,
intl: {} as any,
selectedContract: '', selectedContract: '',
help: {} as any, help: {} as any,
insertValue: {} as any, insertValue: {} as any,
@ -74,7 +73,6 @@ export class CompilationDetailsPlugin extends ViewPlugin {
<RemixUiCompileDetails <RemixUiCompileDetails
plugin={this} plugin={this}
contractProperties={state.contractProperties} contractProperties={state.contractProperties}
intl={state.intl}
selectedContract={state.selectedContract} selectedContract={state.selectedContract}
saveAs={state.saveAs} saveAs={state.saveAs}
help={state.help} help={state.help}

@ -59,6 +59,7 @@
"solidity.copyBytecode": "Copy Bytecode to clipboard", "solidity.copyBytecode": "Copy Bytecode to clipboard",
"solidity.unableToDisplay": "Unable to display", "solidity.unableToDisplay": "Unable to display",
"solidity.download": "Download", "solidity.download": "Download",
"solidity.compileDetails": "Download compilation details (JSON format)",
"solidity.close": "Close", "solidity.close": "Close",
"solidity.contract": "Contract", "solidity.contract": "Contract",
"solidity.displayContractDetails": "Display Contract Details", "solidity.displayContractDetails": "Display Contract Details",

@ -80,7 +80,7 @@ const requiredModules = [
// dependentModules shouldn't be manually activated (e.g hardhat is activated by remixd) // dependentModules shouldn't be manually activated (e.g hardhat is activated by remixd)
const dependentModules = ['foundry', 'hardhat', 'truffle', 'slither'] const dependentModules = ['foundry', 'hardhat', 'truffle', 'slither']
const loadLocalPlugins = ['doc-gen', 'doc-viewer', 'etherscan', 'vyper', 'solhint', 'walletconnect', 'circuit-compiler'] const loadLocalPlugins = ['doc-gen', 'doc-viewer', 'etherscan', 'vyper', 'solhint', 'walletconnect', 'circuit-compiler', 'compilationDetails']
const sensitiveCalls = { const sensitiveCalls = {
fileManager: ['writeFile', 'copyFile', 'rename', 'copyDir'], fileManager: ['writeFile', 'copyFile', 'rename', 'copyDir'],

@ -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>

@ -158,7 +158,6 @@ export const ContractSelection = (props: ContractSelectionProps) => {
const payload = { const payload = {
saveAs: saveAs, saveAs: saveAs,
intl: intl,
contractProperties: {}, contractProperties: {},
selectedContract: '', selectedContract: '',
help: {}, help: {},

Loading…
Cancel
Save