home icon on vertical panel

pull/1/head
LianaHus 6 years ago
parent 26887da521
commit 6b3581ce39
  1. 10
      src/app.js
  2. 2
      src/app/components/plugin-manager-component.js
  3. 16
      src/app/components/vertical-icons-component.js
  4. 5
      src/app/ui/landing-page/landing-page.js

@ -364,8 +364,11 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
pluginManagerComponent.setApp(appManager) pluginManagerComponent.setApp(appManager)
pluginManagerComponent.setStore(appStore) pluginManagerComponent.setStore(appStore)
// Need to have Home initialized before VerticalIconComponent render to access profile of it for icon
const landingPage = new LandingPage(appManager, appStore)
// ----------------- Vertical Icon ---------------------------- // ----------------- Vertical Icon ----------------------------
const verticalIconsComponent = new VerticalIconsComponent('swapPanel', appStore) const verticalIconsComponent = new VerticalIconsComponent('swapPanel', appStore, landingPage.profile)
const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconsComponent) // eslint-disable-line const swapPanelApi = new SwapPanelApi(swapPanelComponent, verticalIconsComponent) // eslint-disable-line
const mainPanelApi = new SwapPanelApi(mainPanelComponent, verticalIconsComponent) // eslint-disable-line const mainPanelApi = new SwapPanelApi(mainPanelComponent, verticalIconsComponent) // eslint-disable-line
const verticalIconsApi = new VerticalIconsApi(verticalIconsComponent) // eslint-disable-line const verticalIconsApi = new VerticalIconsApi(verticalIconsComponent) // eslint-disable-line
@ -373,7 +376,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
self._components.editorpanel.init() self._components.editorpanel.init()
self._components.fileManager.init() self._components.fileManager.init()
self._view.mainpanel.appendChild(self._components.editorpanel.render()) self._view.mainpanel.appendChild(self._components.editorpanel.render())
self._view.iconpanel.appendChild(verticalIconsComponent.render()) self._view.iconpanel.appendChild(verticalIconsComponent.render())
self._view.swappanel.appendChild(swapPanelComponent.render()) self._view.swappanel.appendChild(swapPanelComponent.render())
@ -406,8 +408,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
appManager appManager
) )
let analysis = new AnalysisTab(registry) let analysis = new AnalysisTab(registry)
let debug = new DebuggerTab() let debug = new DebuggerTab()
const landingPage = new LandingPage(appManager, appStore)
let test = new TestTab( let test = new TestTab(
registry.get('filemanager').api, registry.get('filemanager').api,
registry.get('filepanel').api, registry.get('filepanel').api,
@ -438,6 +439,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...appManager.plugins() ...appManager.plugins()
]) ])
framingService.start(appStore, swapPanelApi, verticalIconsApi, mainPanelApi, this._components.resizeFeature) framingService.start(appStore, swapPanelApi, verticalIconsApi, mainPanelApi, this._components.resizeFeature)
// The event listener needs to be registered as early as possible, because the // The event listener needs to be registered as early as possible, because the

@ -156,7 +156,7 @@ class PluginManagerComponent extends BaseApi {
<div id='pluginManager'> <div id='pluginManager'>
<div class="form-group ${css.pluginSearch}"> <div class="form-group ${css.pluginSearch}">
<input onkeyup="${e => this.filterPlugins(e)}" class="form-control" placeholder="Search"> <input onkeyup="${e => this.filterPlugins(e)}" class="form-control" placeholder="Search">
<button onclick="${_ => this.openLocalPlugin()}" class="btn btn-sm text-dark ${css.localPluginBtn}"> <button onclick="${_ => this.openLocalPlugin()}" class="btn btn-sm text-info ${css.localPluginBtn}">
Connect to a Local Plugin Connect to a Local Plugin
</button> </button>
</div> </div>

@ -8,8 +8,9 @@ const EventEmitter = require('events')
// Component // Component
class VerticalIconComponent { class VerticalIconComponent {
constructor (name, appStore) { constructor (name, appStore, homeProfile) {
this.store = appStore this.store = appStore
this.homeProfile = homeProfile
this.events = new EventEmitter() this.events = new EventEmitter()
this.icons = {} this.icons = {}
this.iconKind = {} this.iconKind = {}
@ -215,6 +216,18 @@ class VerticalIconComponent {
} }
render () { render () {
let home = yo`
<div
class="${css.icon}"
onclick="${(e) => {
this._iconClick(name)
globalRegistry.get('appManager').api.ensureActivated('home')
}}"
plugin="${this.homeProfile.name}" title="${this.homeProfile.displayName}"
>
<i class="fab fa-ethereum" alt="${this.homeProfile.name}"></i>
</div>`
this.iconKind['fileexplorer'] = yo` this.iconKind['fileexplorer'] = yo`
<div id='fileExplorerIcons'> <div id='fileExplorerIcons'>
</div> </div>
@ -257,6 +270,7 @@ class VerticalIconComponent {
this.view = yo` this.view = yo`
<div class=${css.icons}> <div class=${css.icons}>
${home}
${this.iconKind['fileexplorer']} ${this.iconKind['fileexplorer']}
${this.iconKind['compile']} ${this.iconKind['compile']}
${this.iconKind['run']} ${this.iconKind['run']}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save