Merge pull request #1238 from ethereum/refactor_analysis

refactor analysis tab
pull/1/head
yann300 7 years ago committed by GitHub
commit 2fbc1948bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 38
      src/app/tabs/analysis-tab.js
  2. 26
      src/app/tabs/styles/analysis-tab-styles.js

@ -1,12 +1,32 @@
var yo = require('yo-yo')
var css = require('./styles/analysis-tab-styles')
var csjs = require('csjs-inject')
var remixLib = require('remix-lib')
function analysisTab (api = {}, events = {}, opts = {}) {
var el = yo`
<div class="${css.analysisTabView} "id="staticanalysisView">
</div>
`
return { render () { return el } }
}
var EventManager = remixLib.EventManager
module.exports = analysisTab
module.exports = class AnalysisTab {
constructor (opts = { api: {}, events: {} }) {
const self = this
self.event = new EventManager()
self._api = opts.api
self._events = opts.events
self._view = { el: null }
self.data = {}
self._components = {}
}
render () {
const self = this
if (self._view.el) return self._view.el
self._view.el = yo`
<div class="${css.analysisTabView} "id="staticanalysisView"></div>`
return self._view.el
}
}
const css = csjs`
.analysisTabView {
padding: 2%;
padding-bottom: 3em;
display: flex;
flex-direction: column;
}
`

@ -1,26 +0,0 @@
// -------------- styling ----------------------
var csjs = require('csjs-inject')
var styleGuide = require('../../ui/styles-guide/theme-chooser')
var styles = styleGuide.chooser()
var css = csjs`
.analysisTabView {
padding: 2%;
padding-bottom: 3em;
display: flex;
flex-direction: column;
}
#staticanalysisView {
display: block;
}
.infoBox {
${styles.infoTextBox}
margin-bottom: 1em;
}
.textBox {
${styles.textBoxL}
margin-bottom: 1em;
}
`
module.exports = css
Loading…
Cancel
Save