separation of concerns

This commit is contained in:
Nate Goldman
2016-03-04 12:42:33 -08:00
parent 52e433fd38
commit 9a0f361e14
15 changed files with 733 additions and 697 deletions

22
renderer/views/app.js Normal file
View File

@@ -0,0 +1,22 @@
module.exports = App
var h = require('virtual-dom/h')
var Header = require('./header')
var Player = require('./player')
var TorrentList = require('./torrent-list')
function App (state, dispatch) {
return h('.app', [
Header(state, dispatch),
h('.content', [
(function () {
if (state.view.url === '/') {
return TorrentList(state, dispatch)
} else if (state.view.url === '/player') {
return Player(state, dispatch)
}
})()
])
])
}