Files
webtorrent-desktop/renderer/views/app.js
Feross Aboukhadijeh 1475e5f95e Use html "class" property
As of this PR (https://github.com/substack/hyperx/pull/22) to hyperx,
attributes are automatically converted to properties for the few cases
where they’re different: class, for, and http-equiv.
2016-03-04 23:21:52 -08:00

27 lines
576 B
JavaScript

module.exports = App
var h = require('virtual-dom/h')
var hyperx = require('hyperx')
var hx = hyperx(h)
var Header = require('./header')
var Player = require('./player')
var TorrentList = require('./torrent-list')
function App (state, dispatch) {
function getView () {
if (state.view.url === '/') {
return TorrentList(state, dispatch)
} else if (state.view.url === '/player') {
return Player(state, dispatch)
}
}
return hx`
<div class="app">
${Header(state, dispatch)}
<div class="content">${getView()}</div>
</div>
`
}