This change does the following: - Show the header on Linux/Windows when fullscreened, but not in the player. Users might fullscreen the app when they’re not playing a video. - Always show the header on OS X (even when fullscreened) since that’s how the user will exit the video. We can work on adding auto-hiding to it later.
36 lines
774 B
JavaScript
36 lines
774 B
JavaScript
module.exports = App
|
|
|
|
var h = require('virtual-dom/h')
|
|
var hyperx = require('hyperx')
|
|
var hx = hyperx(h)
|
|
|
|
var Header = require('./header')
|
|
var Player = require('./player')
|
|
var TorrentList = require('./torrent-list')
|
|
|
|
var isOSX = process.platform === 'darwin'
|
|
|
|
function App (state, dispatch) {
|
|
return hx`
|
|
<div class='app'>
|
|
${getHeader()}
|
|
<div class='content'>${getView()}</div>
|
|
</div>
|
|
`
|
|
|
|
function getHeader () {
|
|
// Hide the header on Windows/Linux when in the player
|
|
if (isOSX || state.url !== '/player') {
|
|
return Header(state, dispatch)
|
|
}
|
|
}
|
|
|
|
function getView () {
|
|
if (state.url === '/') {
|
|
return TorrentList(state, dispatch)
|
|
} else if (state.url === '/player') {
|
|
return Player(state, dispatch)
|
|
}
|
|
}
|
|
}
|