diff --git a/apps/remix-ide/src/app/panels/tab-proxy.js b/apps/remix-ide/src/app/panels/tab-proxy.js index 2277ab07f9..cf3c737c59 100644 --- a/apps/remix-ide/src/app/panels/tab-proxy.js +++ b/apps/remix-ide/src/app/panels/tab-proxy.js @@ -2,6 +2,7 @@ import React from 'react' // eslint-disable-line import ReactDOM from 'react-dom' import { Plugin } from '@remixproject/engine' import { TabsUI } from '@remix-ui/tabs' +import { ViewPluginUI } from '../components/ViewPluginUI' const EventEmitter = require('events') const helper = require('../../lib/helper') @@ -22,6 +23,7 @@ export class TabProxy extends Plugin { this._handlers = {} this.loadedTabs = [] this.el = document.createElement('div') + this.dispatch = null } onActivation () { @@ -285,6 +287,15 @@ export class TabProxy extends Plugin { this.handlers[type] = fn } + setDispatch (dispatch) { + this.dispatch = dispatch + this.renderComponent() + } + + updateComponent(state) { + return + } + renderComponent () { const onSelect = (index) => { if (this.loadedTabs[index]) { @@ -307,12 +318,17 @@ export class TabProxy extends Plugin { const onReady = (api) => { this.tabsApi = api } - ReactDOM.render( - - , this.el) + this.dispatch({ + loadedTabs: this.loadedTabs, + onSelect, + onClose, + onZoomIn, + onZoomOut, + onReady + }) } renderTabsbar () { - return this.el + return
} }