mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 01:17:22 +00:00
Rename components files to JSX
This commit is contained in:
parent
a100cbef4f
commit
884c53d6ae
8 changed files with 0 additions and 0 deletions
51
src/views/HomeView.jsx
Normal file
51
src/views/HomeView.jsx
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
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 ({ themeEngine }) {
|
||||
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 {...{
|
||||
themeEngine
|
||||
}} />
|
||||
</li>
|
||||
<li>
|
||||
<FileSelector {...{
|
||||
setTargetName,
|
||||
setTargetUrl
|
||||
}} />
|
||||
</li>
|
||||
<li>
|
||||
<URLSelector {...{
|
||||
setTargetName,
|
||||
setTargetUrl
|
||||
}} />
|
||||
</li>
|
||||
</ul>
|
||||
{ targetUrl
|
||||
? playButton(targetName, targetUrl, themeEngine.currentTheme)
|
||||
: null }
|
||||
</main>)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue