mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-04 17:07:22 +00:00
Add a special class to the app container when the player page is active
This commit is contained in:
parent
42015eca8f
commit
5b283d2789
6 changed files with 31 additions and 13 deletions
13
src/index.js
13
src/index.js
|
|
@ -1,7 +1,10 @@
|
|||
import { h, render } from 'preact'
|
||||
import { Route, Router, Switch } from 'wouter-preact'
|
||||
|
||||
import { useHashLocation } from '~/src/utils/utils.routing'
|
||||
import {
|
||||
useHashLocation,
|
||||
extractView
|
||||
} from '~/src/utils/utils.routing'
|
||||
import {
|
||||
useThemeEngine
|
||||
} from '~/src/themes/themes'
|
||||
|
|
@ -14,10 +17,15 @@ import '~/src/style/base.css'
|
|||
|
||||
function App () {
|
||||
const themeEngine = useThemeEngine()
|
||||
const [location] = useHashLocation()
|
||||
|
||||
return (
|
||||
<Router hook={useHashLocation}>
|
||||
<div className={['app', themeEngine.currentTheme].join(' ')}>
|
||||
<div className={[
|
||||
'app',
|
||||
extractView(location),
|
||||
themeEngine.currentTheme].join(' ')}>
|
||||
|
||||
<Switch>
|
||||
<Route path='/'>
|
||||
<HomeView {...{
|
||||
|
|
@ -37,6 +45,7 @@ function App () {
|
|||
404
|
||||
</Route>
|
||||
</Switch>
|
||||
|
||||
</div>
|
||||
</Router>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue