in progress: move webtorrent into background BrowserWindow
This commit is contained in:
@@ -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')
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user