mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-04 17:07:22 +00:00
Player: add the singleWindow option
This commit is contained in:
parent
7240be1120
commit
18da26dc20
4 changed files with 45 additions and 18 deletions
24
src/index.js
24
src/index.js
|
|
@ -21,6 +21,12 @@ function App () {
|
|||
const themeEngine = useThemeEngine()
|
||||
const [location] = useHashLocation()
|
||||
|
||||
const playerView = (themeEngine, singleWindow) => params =>
|
||||
(<PlayerView {...{
|
||||
...themeEngine,
|
||||
...params,
|
||||
singleWindow}}/>)
|
||||
|
||||
return (
|
||||
<Router hook={useHashLocation}>
|
||||
<div className={[
|
||||
|
|
@ -37,18 +43,20 @@ function App () {
|
|||
<Route path='/games/'>
|
||||
<GamesView />
|
||||
</Route>
|
||||
|
||||
<Route path='/play/:encodedUrl'>
|
||||
{params => <PlayerView {...{
|
||||
...themeEngine,
|
||||
...params
|
||||
}} />}
|
||||
{ playerView(themeEngine, false) }
|
||||
</Route>
|
||||
<Route path='/play/:encodedUrl/focus'>
|
||||
{ playerView(themeEngine, true) }
|
||||
</Route>
|
||||
<Route path='/play/:encodedUrl/:theme/focus'>
|
||||
{ playerView(themeEngine, true) }
|
||||
</Route>
|
||||
<Route path='/play/:encodedUrl/:theme'>
|
||||
{params => <PlayerView {...{
|
||||
...themeEngine,
|
||||
...params
|
||||
}} />}
|
||||
{ playerView(themeEngine, false) }
|
||||
</Route>
|
||||
|
||||
<Route>
|
||||
<NotFoundView />
|
||||
</Route>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue