don't calculate styles in JavaScript whenever possible

This commit is contained in:
Feross Aboukhadijeh
2016-03-05 22:06:32 -08:00
parent f161a7c7e7
commit e0122f81e5
3 changed files with 14 additions and 12 deletions

View File

@@ -11,10 +11,11 @@ var TorrentList = require('./torrent-list')
var isOSX = process.platform === 'darwin'
function App (state, dispatch) {
var cls = []
if (state.url === '/player') {
cls.push('player')
}
var cls = [
process.platform,
state.isFullScreen ? 'fullscreen' : 'not-fullscreen',
state.url === '/player' ? 'view-player' : ''
]
return hx`
<div class='app ${cls.join(' ')}'>