mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 17:37:21 +00:00
PlayerView: add MenuOverlay
This commit is contained in:
parent
7437d41073
commit
cf96d2852f
4 changed files with 46 additions and 41 deletions
|
|
@ -2,15 +2,18 @@ import { h } from 'preact'
|
|||
import { useState, useEffect } from 'preact/hooks'
|
||||
|
||||
import UrlPlayer from '~/src/components/Player/UrlPlayer'
|
||||
import MenuOverlay from '~/src/components/Player/MenuOverlay'
|
||||
|
||||
import './PlayerView.css'
|
||||
|
||||
const decode = (encodedUrl) => decodeURIComponent(encodedUrl)
|
||||
|
||||
export default function PlayerView ({
|
||||
setTheme, theme, encodedUrl, singleWindow,
|
||||
theme, themeEngine, encodedUrl, singleWindow,
|
||||
}) {
|
||||
useEffect(() => setTheme(theme), [setTheme, theme])
|
||||
useEffect(() => {
|
||||
themeEngine.setTheme(theme)
|
||||
}, [theme, themeEngine])
|
||||
|
||||
const [targetUrl, setTargetUrl] = useState(decode(encodedUrl))
|
||||
|
||||
|
|
@ -20,6 +23,9 @@ export default function PlayerView ({
|
|||
|
||||
return (
|
||||
<main>
|
||||
<MenuOverlay {...{
|
||||
themeEngine,
|
||||
}}/>
|
||||
<UrlPlayer {...{
|
||||
url: targetUrl,
|
||||
singleWindow,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue