mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 01:17:22 +00:00
Linting
This commit is contained in:
parent
c9f42e497a
commit
0474e0355e
6 changed files with 10 additions and 15 deletions
|
|
@ -27,7 +27,6 @@
|
|||
"wouter-preact": "^2.7.3"
|
||||
},
|
||||
"staticFiles": {
|
||||
"staticPath": "node_modules/emglken/build",
|
||||
"excludeGlob": "*.js"
|
||||
"staticPath": "node_modules/emglken/build/*.wasm"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { h } from 'preact'
|
||||
import { useState, useEffect } from 'preact/hooks'
|
||||
|
||||
import { prepareVM } from '~/src/common/if'
|
||||
import { prepareVM } from './common/if'
|
||||
|
||||
const INITIAL_STATUS = {
|
||||
stage: 'loading',
|
||||
|
|
@ -25,7 +25,6 @@ export default function ({url}) {
|
|||
|
||||
return (
|
||||
<main>
|
||||
{url}
|
||||
{status.details}
|
||||
</main>)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// import CheapGlkOte from 'cheap-glkote'
|
||||
// import engine from 'emglken/src/tads.js'
|
||||
|
||||
import { engineByFilename } from '~/src/common/engines'
|
||||
import { engineByFilename } from './engines'
|
||||
|
||||
export const prepareVM = ({ url, setStatus, setVM }) => _ => {
|
||||
const st = (stage, details) => args => {
|
||||
|
|
@ -18,13 +18,13 @@ const assertTheme = theme =>
|
|||
? theme
|
||||
: DEFAULT_THEME
|
||||
|
||||
export const useThemeEngine = (defaultTheme = DEFAULT_THEME) => {
|
||||
export const useThemeEngine = (initialTheme = DEFAULT_THEME) => {
|
||||
const [currentTheme, setCurrentTheme] =
|
||||
useState(DEFAULT_THEME)
|
||||
useState(initialTheme)
|
||||
|
||||
const setTheme = useCallback(theme => {
|
||||
setCurrentTheme(assertTheme(theme))
|
||||
}, [currentTheme]);
|
||||
}, [currentTheme])
|
||||
|
||||
return { currentTheme, setTheme, themes };
|
||||
return { currentTheme, setTheme, themes }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,3 @@ export const useHashLocation = () => {
|
|||
|
||||
export const buildPlayLinkHref = (url, theme) =>
|
||||
`/#/play/${theme}/${encodeURIComponent(url)}`
|
||||
|
||||
export const getFileExtension = fileName =>
|
||||
fileName.split('.').pop()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue