Player: add the singleWindow option

This commit is contained in:
He4eT 2021-07-19 23:37:22 +05:00 committed by Alexey
commit 18da26dc20
4 changed files with 45 additions and 18 deletions

View file

@ -7,7 +7,9 @@ import './PlayerView.css'
const decode = encodedUrl => decodeURIComponent(encodedUrl)
export default function ({ setTheme, theme, encodedUrl }) {
export default function ({
setTheme, theme, encodedUrl, singleWindow
}) {
useEffect(() => setTheme(theme), [theme])
const [targetUrl, setTargetUrl] = useState(decode(encodedUrl))
@ -18,7 +20,9 @@ export default function ({ setTheme, theme, encodedUrl }) {
return (
<main>
<UrlPlayer url={targetUrl} />
<UrlPlayer {...{
url: targetUrl,
singleWindow}}/>
</main>
)
}