aboutsummaryrefslogtreecommitdiffstats
path: root/mock-dev.js
diff options
context:
space:
mode:
Diffstat (limited to 'mock-dev.js')
-rw-r--r--mock-dev.js73
1 files changed, 40 insertions, 33 deletions
diff --git a/mock-dev.js b/mock-dev.js
index 8e1923a82..b6652bdf7 100644
--- a/mock-dev.js
+++ b/mock-dev.js
@@ -85,40 +85,47 @@ actions.update = function(stateName) {
var css = MetaMaskUiCss()
injectCss(css)
-const container = document.querySelector('#app-content')
-
// parse opts
var store = configureStore(firstState)
// start app
-render(
- h('.super-dev-container', [
-
- h('button', {
- onClick: (ev) => {
- ev.preventDefault()
- store.dispatch(actions.update('terms'))
- },
- style: {
- margin: '19px 19px 0px 19px',
- },
- }, 'Reset State'),
-
- h(Selector, { actions, selectedKey: selectedView, states, store }),
-
- h('.mock-app-root', {
- style: {
- height: '500px',
- width: '360px',
- boxShadow: 'grey 0px 2px 9px',
- margin: '20px',
- },
- }, [
- h(Root, {
- store: store,
- }),
- ]),
-
- ]
-), container)
-
+startApp()
+
+function startApp(){
+ const body = document.body
+ const container = document.createElement('div')
+ container.id = 'app-content'
+ body.appendChild(container)
+ console.log('container', container)
+
+ render(
+ h('.super-dev-container', [
+
+ h('button', {
+ onClick: (ev) => {
+ ev.preventDefault()
+ store.dispatch(actions.update('terms'))
+ },
+ style: {
+ margin: '19px 19px 0px 19px',
+ },
+ }, 'Reset State'),
+
+ h(Selector, { actions, selectedKey: selectedView, states, store }),
+
+ h('.mock-app-root', {
+ style: {
+ height: '500px',
+ width: '360px',
+ boxShadow: 'grey 0px 2px 9px',
+ margin: '20px',
+ },
+ }, [
+ h(Root, {
+ store: store,
+ }),
+ ]),
+
+ ]
+ ), container)
+}