add empty list state

This commit is contained in:
Nate Goldman
2016-03-07 15:28:19 -08:00
parent aa3e12dadd
commit 96fa5747a7
2 changed files with 24 additions and 1 deletions

View File

@@ -8,9 +8,19 @@ var prettyBytes = require('pretty-bytes')
function TorrentList (state, dispatch) {
var list = state.client.torrents.map((torrent) => renderTorrent(torrent, dispatch))
if (list.length === 0) list = emptyList()
return hx`<div class='torrent-list'>${list}</div>`
}
function emptyList () {
return hx`
<div class="get-started">
<p>No torrents here yet.</p>
<p>Drop a file or paste an address to get started!</p>
</div>
`
}
// Renders a torrent in the torrent list
// Includes name, download status, play button, background image
// May be expanded for additional info, including the list of files inside