mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 01:17:22 +00:00
Rename Views
This commit is contained in:
parent
3d5029173f
commit
d7ba6d8c60
3 changed files with 4 additions and 4 deletions
|
|
@ -1,53 +0,0 @@
|
|||
import { h } from 'preact'
|
||||
import { useState } from 'preact/hooks'
|
||||
|
||||
import { Link } from 'wouter-preact'
|
||||
|
||||
import FileSelector from '~/src/components/FileSelector'
|
||||
import URLSelector from '~/src/components/URLSelector'
|
||||
import ThemeSelector from '~/src/components/ThemeSelector'
|
||||
|
||||
import { buildPlayLinkHref } from '~/src/utils/utils.routing'
|
||||
|
||||
const playButton = (name, url, theme) => (
|
||||
<Link href={buildPlayLinkHref(url, theme)}>
|
||||
Play "{name}"
|
||||
</Link>)
|
||||
|
||||
export default function ({ themeList, currentTheme, setTheme }) {
|
||||
const [targetName, setTargetName] = useState(null)
|
||||
const [targetUrl, setTargetUrl] = useState(null)
|
||||
|
||||
return (
|
||||
<main>
|
||||
<p>
|
||||
You can browse some <Link href='/top100'>
|
||||
games from IFDB
|
||||
</Link> or play a game from a file.
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<ThemeSelector {...{
|
||||
currentTheme,
|
||||
themeList,
|
||||
setTheme
|
||||
}} />
|
||||
</li>
|
||||
<li>
|
||||
<FileSelector {...{
|
||||
setTargetName,
|
||||
setTargetUrl
|
||||
}} />
|
||||
</li>
|
||||
<li>
|
||||
<URLSelector {...{
|
||||
setTargetName,
|
||||
setTargetUrl
|
||||
}} />
|
||||
</li>
|
||||
</ul>
|
||||
{ targetUrl
|
||||
? playButton(targetName, targetUrl, currentTheme)
|
||||
: null }
|
||||
</main>)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue