diff --git a/apps/remix-ide/src/app/tabs/analysis-tab.js b/apps/remix-ide/src/app/tabs/analysis-tab.js index b3bba2705c..de515eec52 100644 --- a/apps/remix-ide/src/app/tabs/analysis-tab.js +++ b/apps/remix-ide/src/app/tabs/analysis-tab.js @@ -4,7 +4,7 @@ import ReactDOM from 'react-dom' import { EventEmitter } from 'events' import {RemixUiStaticAnalyser} from '@remix-ui/static-analyser' // eslint-disable-line import * as packageJson from '../../../../../package.json' -var Renderer = require('../ui/renderer') +// var Renderer = require('../ui/renderer') var EventManager = require('../../lib/events') @@ -30,7 +30,7 @@ class AnalysisTab extends ViewPlugin { this.element = document.createElement('div') this.element.setAttribute('id', 'staticAnalyserView') this._components = { - renderer: new Renderer(this) + // renderer: new Renderer(this) } this._components.registry = this.registry this._deps = { diff --git a/apps/remix-ide/src/app/tabs/compile-tab.js b/apps/remix-ide/src/app/tabs/compile-tab.js index b9c50cc654..9652823ce9 100644 --- a/apps/remix-ide/src/app/tabs/compile-tab.js +++ b/apps/remix-ide/src/app/tabs/compile-tab.js @@ -85,10 +85,11 @@ class CompileTab extends ViewPlugin { if (this._view.errorContainer) { this._view.errorContainer.innerHTML = '' } - this.compilerContainer.currentFile = '' + this.currentFile = '' this.data.contractsDetails = {} yo.update(this._view.contractSelection, this.contractSelection()) this.emit('statusChanged', { key: 'none' }) + this.renderComponent() } /************ @@ -137,12 +138,14 @@ class CompileTab extends ViewPlugin { this.compileTabLogic.event.on('removeAnnotations', this.data.eventHandlers.onRemoveAnnotations) this.data.eventHandlers.onCurrentFileChanged = (name) => { - this.compilerContainer.currentFile = name + this.currentFile = name + this.renderComponent() } this.fileManager.events.on('currentFileChanged', this.data.eventHandlers.onCurrentFileChanged) this.data.eventHandlers.onNoFileSelected = () => { - this.compilerContainer.currentFile = '' + this.currentFile = '' + this.renderComponent() } this.fileManager.events.on('noFileSelected', this.data.eventHandlers.onNoFileSelected) @@ -499,6 +502,7 @@ class CompileTab extends ViewPlugin { queryParams={this.queryParams} plugin={this} compileTabLogic={this.compileTabLogic} + compiledFileName={this.currentFile} /> , this.el) } diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 9ffbda3bc9..50c0d325ba 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -7,7 +7,7 @@ import { canUseWorker, baseURLBin, baseURLWasm, urlFromVersion, pathToURL, promi import './css/style.css' export const CompilerContainer = (props: CompilerContainerProps) => { - const { editor, config, queryParams, compileTabLogic, tooltip, modal } = props // eslint-disable-line + const { editor, config, queryParams, compileTabLogic, tooltip, modal, compiledFileName } = props // eslint-disable-line const [state, setState] = useState({ hideWarnings: false, autoCompile: false, @@ -60,6 +60,12 @@ export const CompilerContainer = (props: CompilerContainerProps) => { } }, [compileTabLogic]) + useEffect(() => { + setState(prevState => { + return { ...prevState, compiledFileName } + }) + }, [compiledFileName]) + const compilerLoaded = (version: string) => { setVersionText(version) } diff --git a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx index 080041e8b1..362ee4f761 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx @@ -7,7 +7,7 @@ import { ModalDialog } from '@remix-ui/modal-dialog' // eslint-disable-line import './css/style.css' export const SolidityCompiler = (props: SolidityCompilerProps) => { - const { editor, config, queryParams, plugin, compileTabLogic } = props + const { editor, config, queryParams, plugin, compileTabLogic, compiledFileName } = props const [state, setState] = useState({ contractsDetails: {}, eventHandlers: {}, @@ -64,7 +64,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => { return ( <>
- + {/* ${this._view.contractSelection} */}
diff --git a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts index 64c8d982c1..b0d701b9e1 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts @@ -7,7 +7,8 @@ export interface SolidityCompilerProps { contentImport: any, plugin: any, queryParams: any, - compileTabLogic: any + compileTabLogic: any, + compiledFileName: string } export interface CompilerContainerProps { @@ -16,7 +17,8 @@ export interface CompilerContainerProps { queryParams: any, compileTabLogic: any, tooltip: (message: string) => void, - modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void + modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, + compiledFileName: string } export interface ContractSelectionProps { contractMap: {