settings and debugger

pull/2074/head
filip mertens 3 years ago
parent f682c6fc9d
commit e295859ba0
  1. 10
      apps/remix-ide/src/app/tabs/debugger-tab.js
  2. 14
      apps/remix-ide/src/app/tabs/settings-tab.js
  3. 4
      libs/remix-ui/app/src/lib/remix-app/remix-app.tsx
  4. 6
      libs/remix-ui/panel/src/lib/plugins/panel-plugin.tsx

@ -51,9 +51,8 @@ export class DebuggerTab extends DebuggerApiMixin(ViewPlugin) {
this.on('fetchAndCompile', 'sourceVerificationNotAvailable', () => { this.on('fetchAndCompile', 'sourceVerificationNotAvailable', () => {
this.call('notification', 'toast', sourceVerificationNotAvailableToastMsg()) this.call('notification', 'toast', sourceVerificationNotAvailableToastMsg())
}) })
this.renderComponent() return <DebuggerUI debuggerAPI={this} />
return this.el
} }
showMessage (title, message) { showMessage (title, message) {
@ -68,9 +67,4 @@ export class DebuggerTab extends DebuggerApiMixin(ViewPlugin) {
} }
} }
renderComponent () {
ReactDOM.render(
<DebuggerUI debuggerAPI={this} />
, this.el)
}
} }

@ -33,11 +33,19 @@ module.exports = class SettingsTab extends ViewPlugin {
} }
onActivation () { onActivation () {
this.renderComponent()
} }
render () { render() {
return this.element return (
<div id='settingsTab'>
<RemixUiSettings
config={this.config}
editor={this.editor}
_deps={this._deps}
useMatomoAnalytics={this.useMatomoAnalytics}
/>
</div>
);
} }
renderComponent () { renderComponent () {

@ -92,14 +92,14 @@ export const ViewPluginUI = (props: IViewPluginUI) => {
const [state, setState] = useState<any>(null) const [state, setState] = useState<any>(null)
useEffect(() => { useEffect(() => {
console.log(props.plugin) // console.log(props.plugin)
if(props.plugin.setDispatch){ if(props.plugin.setDispatch){
props.plugin.setDispatch(setState) props.plugin.setDispatch(setState)
} }
}, []) }, [])
useEffect(() => { useEffect(() => {
console.log(state) // console.log(state)
}, [state]) }, [state])
return ( return (

@ -10,8 +10,14 @@ const RemixUIPanelPlugin = (props: panelPLuginProps, panelRef: any) => {
const localRef = useRef<HTMLDivElement>(null) const localRef = useRef<HTMLDivElement>(null)
const [view, setView] = useState<JSX.Element | HTMLDivElement>() const [view, setView] = useState<JSX.Element | HTMLDivElement>()
useEffect(() => { useEffect(() => {
const ref:any = panelRef || localRef const ref:any = panelRef || localRef
if (ref.current) { if (ref.current) {
if(React.isValidElement(props.pluginRecord.view)) {
console.log('is REACT element', props.pluginRecord.profile.name)
}else{
console.log('is HTML element', props.pluginRecord.profile.name)
}
if (props.pluginRecord.view) { if (props.pluginRecord.view) {
if (React.isValidElement(props.pluginRecord.view)) { if (React.isValidElement(props.pluginRecord.view)) {
setView(props.pluginRecord.view) setView(props.pluginRecord.view)

Loading…
Cancel
Save