@@ -5,16 +5,25 @@ import { PluginViewWrapper } from '@remix-ui/helper'
55import { Plugin } from '@remixproject/engine'
66import { EventEmitter } from 'events'
77import { ThemeModule } from '../tabs/theme-module'
8+ import * as packageJson from '../../../../../package.json'
89import { TemplateExplorerProvider } from 'libs/remix-ui/template-explorer-modal/context/template-explorer-context'
10+ import { ViewPlugin } from '@remixproject/engine-web'
911
1012const pluginProfile = {
11- name : 'remix-template-explorer-modal' ,
12- displayName : 'Remix Generic Modal' ,
13- description : 'Remix Generic Modal for every type of content meant for a modal' ,
14- methods : [ 'openModal' ]
13+ name : 'templateexplorermodal' ,
14+ displayName : 'Template Explorer Modal' ,
15+ description : 'Template Explorer Modal' ,
16+ methods : [ 'openModal' ] ,
17+ events : [ ] ,
18+ maintainedBy : 'Remix' ,
19+ kind : 'templateexplorermodal' ,
20+ location : 'mainPanel' ,
21+ version : packageJson . version ,
22+ permission : true ,
23+ documentation : 'https://remix-ide.readthedocs.io/en/latest/template-explorer-modal.html'
1524}
1625
17- export class TemplateExplorerModalPlugin extends Plugin {
26+ export class TemplateExplorerModalPlugin extends ViewPlugin {
1827 element : HTMLDivElement
1928 dispatch : React . Dispatch < any > = ( ) => { }
2029 event : any
@@ -30,13 +39,18 @@ export class TemplateExplorerModalPlugin extends Plugin {
3039 }
3140
3241 async onActivation ( ) : Promise < void > {
42+ console . trace ( )
3343 this . on ( 'theme' , 'themeChanged' , ( theme : any ) => {
3444 this . theme = theme
3545 } )
3646 }
3747
48+ openModal ( ) {
49+ console . log ( 'This is openModal' )
50+ }
51+
3852 onDeactivation ( ) : void {
39- this . element . remove ( )
53+
4054 }
4155
4256 setDispatch ( dispatch : React . Dispatch < any > ) {
@@ -58,13 +72,14 @@ export class TemplateExplorerModalPlugin extends Plugin {
5872
5973 renderComponent ( ) : void {
6074 this . dispatch ( {
61- plugins : this ,
75+ ... this
6276 } )
6377 }
6478
65- updateComponent ( ) {
79+ updateComponent ( state : any ) {
80+ console . log ( 'what is state' , state )
6681 return (
67- < TemplateExplorerProvider plugin = { this } />
82+ < TemplateExplorerProvider plugin = { state } />
6883 )
6984 }
7085}
0 commit comments