pull/5370/head
bunsenstraat 3 years ago
parent 790ddfacd1
commit 8152510721
  1. 31
      apps/remix-ide/src/app/panels/terminal.js
  2. 4
      apps/remix-ide/src/index.tsx

@ -9,6 +9,7 @@ const vm = require('vm')
const EventManager = require('../../lib/events') const EventManager = require('../../lib/events')
import { CompilerImports } from '@remix-project/core-plugin' // eslint-disable-line import { CompilerImports } from '@remix-project/core-plugin' // eslint-disable-line
import { ViewPluginUI } from '../components/ViewPluginUI'
const KONSOLES = [] const KONSOLES = []
@ -79,9 +80,12 @@ class Terminal extends Plugin {
this.call('menuicons', 'select', 'debugger') this.call('menuicons', 'select', 'debugger')
this.call('debugger', 'debug', hash) this.call('debugger', 'debug', hash)
}) })
this.dispatch = null
} }
onActivation () { onActivation() {
this.renderComponent() this.renderComponent()
} }
@ -100,19 +104,28 @@ class Terminal extends Plugin {
this.terminalApi.log(message) this.terminalApi.log(message)
} }
setDispatch(dispatch) {
this.dispatch = dispatch
}
render () { render () {
return this.element return <div id='terminal-view' className='panel' data-id='terminalContainer-view'><ViewPluginUI plugin={this}/></div>
}
updateComponent(state) {
console.log("render terminal")
return <RemixUiTerminal
plugin={state.plugin}
onReady={state.onReady}
/>
} }
renderComponent () { renderComponent () {
const onReady = (api) => { this.terminalApi = api } const onReady = (api) => { this.terminalApi = api }
ReactDOM.render( this.dispatch({
<RemixUiTerminal plugin: this,
plugin={this} onReady: onReady
onReady={onReady} })
/>,
this.element
)
} }
scroll2bottom () { scroll2bottom () {

@ -33,9 +33,9 @@ import ('./app').then((AppComponent) => {
const appComponent = new AppComponent.default() const appComponent = new AppComponent.default()
appComponent.run().then(() => { appComponent.run().then(() => {
render( render(
<React.StrictMode> <>
<RemixApp app={appComponent} /> <RemixApp app={appComponent} />
</React.StrictMode>, </>,
document.getElementById('root') document.getElementById('root')
) )
}) })

Loading…
Cancel
Save