in progress: move webtorrent into background BrowserWindow

This commit is contained in:
Feross Aboukhadijeh
2016-02-18 19:10:07 -08:00
parent d122ce9f36
commit bbe982d645
11 changed files with 259 additions and 257 deletions

View File

@@ -2,15 +2,26 @@ module.exports = App
var h = require('virtual-dom/h')
function App (state) {
var count = state.count
return h('div', {
style: {
textAlign: 'center',
lineHeight: (100 + count) + 'px',
border: '1px solid red',
width: (100 + count) + 'px',
height: (100 + count) + 'px'
}
}, [ String(count) ])
function App (state, handler) {
var torrents = state.torrents
var list = torrents.map(function (torrent) {
return h('.torrent', [
h('.name', torrent.name)
])
})
return h('.app', [
h('h1', 'WebTorrent'),
h('.torrent-list', list),
h('.add', [
h('button', {
onclick: onAddTorrent
}, 'Add New Torrent')
])
])
function onAddTorrent (e) {
handler('addTorrent', '6a9759bffd5c0af65319979fb7832189f4f3c35d')
}
}