mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 01:17:22 +00:00
eslint fix
This commit is contained in:
parent
35e8f2ce6f
commit
cc1df287be
7 changed files with 27 additions and 23 deletions
|
|
@ -52,7 +52,7 @@ export default function ({
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTargetWindow(
|
setTargetWindow(
|
||||||
windows
|
windows
|
||||||
.find(({id}) =>
|
.find(({ id }) =>
|
||||||
id === currentWindowId))
|
id === currentWindowId))
|
||||||
}, [currentWindowId, windows])
|
}, [currentWindowId, windows])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
import { h } from 'preact'
|
import { h } from 'preact'
|
||||||
import { useState, useEffect } from 'preact/hooks'
|
import { useState, useEffect } from 'preact/hooks'
|
||||||
import {
|
|
||||||
compressToUTF16 as encode,
|
|
||||||
decompressFromUTF16 as decode
|
|
||||||
} from 'lz-string'
|
|
||||||
|
|
||||||
import CheapGlkOte from 'cheap-glkote'
|
import CheapGlkOte from 'cheap-glkote'
|
||||||
|
|
||||||
|
|
@ -13,7 +9,7 @@ import GridBuffer from './GridBuffer'
|
||||||
import InputBox from './InputBox'
|
import InputBox from './InputBox'
|
||||||
import Status from './Status'
|
import Status from './Status'
|
||||||
|
|
||||||
import {Handlers} from './playerHandlers'
|
import { Handlers } from './playerHandlers'
|
||||||
|
|
||||||
import './player.css'
|
import './player.css'
|
||||||
|
|
||||||
|
|
@ -74,8 +70,8 @@ export default function ({
|
||||||
}
|
}
|
||||||
|
|
||||||
return ({
|
return ({
|
||||||
'buffer': <TextBuffer {...props} />,
|
buffer: <TextBuffer {...props} />,
|
||||||
'grid': <GridBuffer {...props} />
|
grid: <GridBuffer {...props} />
|
||||||
})[currentWindow.type]
|
})[currentWindow.type]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,18 +81,19 @@ export default function ({
|
||||||
return status.stage !== 'ready'
|
return status.stage !== 'ready'
|
||||||
? (<Status {...status} />)
|
? (<Status {...status} />)
|
||||||
: (<section className='ifplayer'>
|
: (<section className='ifplayer'>
|
||||||
<section className='output'>{
|
<section className='output'>{
|
||||||
windows
|
windows
|
||||||
.sort(byTop)
|
.sort(byTop)
|
||||||
.filter(singleWindow
|
.filter(singleWindow
|
||||||
? ({id}) => id === currentWindowId
|
? ({ id }) => id === currentWindowId
|
||||||
: _ => true)
|
: _ => true)
|
||||||
.map(textWindow(inbox))}
|
.map(textWindow(inbox))}
|
||||||
</section>
|
</section>
|
||||||
<InputBox {...{
|
<InputBox {...{
|
||||||
inputType,
|
inputType,
|
||||||
windows,
|
windows,
|
||||||
currentWindowId,
|
currentWindowId,
|
||||||
sendMessage }} />
|
sendMessage
|
||||||
</section>)
|
}} />
|
||||||
|
</section>)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ export default function ({ inbox, currentWindow }) {
|
||||||
tabindex='0'
|
tabindex='0'
|
||||||
ref={textBufferEl}
|
ref={textBufferEl}
|
||||||
className={classes}>
|
className={classes}>
|
||||||
{messages.map(TextMessage)}
|
{messages.map(TextMessage)}
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,6 @@ export default function ({ url, singleWindow }) {
|
||||||
? (<Player {...{
|
? (<Player {...{
|
||||||
vmParts,
|
vmParts,
|
||||||
singleWindow
|
singleWindow
|
||||||
}}/>)
|
}} />)
|
||||||
: (<Status {...status} />)
|
: (<Status {...status} />)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
import {
|
||||||
|
compressToUTF16 as encode,
|
||||||
|
decompressFromUTF16 as decode
|
||||||
|
} from 'lz-string'
|
||||||
|
|
||||||
export const Handlers = ({
|
export const Handlers = ({
|
||||||
setStatus,
|
setStatus,
|
||||||
setWindows,
|
setWindows,
|
||||||
|
|
@ -13,9 +18,9 @@ export const Handlers = ({
|
||||||
setWindows(windows)
|
setWindows(windows)
|
||||||
},
|
},
|
||||||
onUpdateInputs: data => {
|
onUpdateInputs: data => {
|
||||||
if (data.length === 0) return void null
|
if (data.length === 0) return null
|
||||||
|
|
||||||
const {type, id} = data[0]
|
const { type, id } = data[0]
|
||||||
setCurrentWindowId(id)
|
setCurrentWindowId(id)
|
||||||
setInputType(type)
|
setInputType(type)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ function App () {
|
||||||
(<PlayerView {...{
|
(<PlayerView {...{
|
||||||
...themeEngine,
|
...themeEngine,
|
||||||
...params,
|
...params,
|
||||||
singleWindow}}/>)
|
singleWindow
|
||||||
|
}} />)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Router hook={useHashLocation}>
|
<Router hook={useHashLocation}>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@ export default function ({
|
||||||
<main>
|
<main>
|
||||||
<UrlPlayer {...{
|
<UrlPlayer {...{
|
||||||
url: targetUrl,
|
url: targetUrl,
|
||||||
singleWindow}}/>
|
singleWindow
|
||||||
|
}} />
|
||||||
</main>
|
</main>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue