1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

development - fix ui dev

This commit is contained in:
kumavis 2017-09-29 11:50:24 -07:00
parent cdf41c2857
commit 19e7adad19
2 changed files with 75 additions and 72 deletions

View File

@ -3,31 +3,25 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>MetaMask</title> <title>MetaMask</title>
</head> </head>
<body> <body>
<!-- app content -->
<div id="app-content" style="height: 100%"></div>
<script src="./bundle.js" type="text/javascript" charset="utf-8"></script> <script src="./bundle.js" type="text/javascript" charset="utf-8"></script>
</body> <style>
html, body, #test-container, .super-dev-container {
<style>
html, body, #test-container, .super-dev-container {
height: 100%; height: 100%;
width: 100%; width: 100%;
position: relative; position: relative;
background: white; background: white;
} }
#app-content { #app-content {
background: #F7F7F7; background: #F7F7F7;
} }
</style> </style>
<script> <script>
liveReloadCode(Date.now(), 300) liveReloadCode(Date.now(), 300)
function liveReloadCode(lastUpdate, updateRate) { function liveReloadCode(lastUpdate, updateRate) {
setTimeout(iter, updateRate) setTimeout(iter, updateRate)
function iter() { function iter() {
@ -55,10 +49,12 @@ function liveReloadCode(lastUpdate, updateRate) {
xhr.send(null) xhr.send(null)
} }
} }
function reload() { function reload() {
window.location.reload() window.location.reload()
} }
</script> </script>
</body>
</html> </html>

View File

@ -61,13 +61,19 @@ const actions = {
var css = MetaMaskUiCss() var css = MetaMaskUiCss()
injectCss(css) injectCss(css)
const container = document.querySelector('#test-container')
// parse opts // parse opts
var store = configureStore(states[selectedView]) var store = configureStore(states[selectedView])
// start app // start app
render( startApp()
function startApp(){
const body = document.body
const container = document.createElement('div')
container.id = 'test-container'
body.appendChild(container)
render(
h('.super-dev-container', [ h('.super-dev-container', [
h(Selector, { actions, selectedKey: selectedView, states, store }), h(Selector, { actions, selectedKey: selectedView, states, store }),
@ -86,5 +92,6 @@ render(
]), ]),
] ]
), container) ), container)
}