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
1e1614706a
commit
1e0b16361f
10 changed files with 25 additions and 23 deletions
|
|
@ -10,7 +10,7 @@ export default ({ name, ifdb, url }) => (
|
|||
<h4>{name}</h4>
|
||||
<a
|
||||
target='_blank'
|
||||
rel='noopener'
|
||||
rel='noopener noreferrer'
|
||||
href={ifdb}>
|
||||
IFDB page
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { h } from 'preact'
|
||||
import { useEffect, useRef, useState } from 'preact/hooks'
|
||||
import { useEffect, useState } from 'preact/hooks'
|
||||
|
||||
import TextMessage from './TextMessage'
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ export default function ({ inbox, currentWindow }) {
|
|||
|
||||
const newOrPrev = (cur, prev) => i => {
|
||||
const byId = (list, i) =>
|
||||
list.find(({line}) => line === i)
|
||||
list.find(({ line }) => line === i)
|
||||
|
||||
return byId(cur, i) || byId(prev, i)
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ export default function ({ inbox, currentWindow }) {
|
|||
rawMessages
|
||||
.map(x => x.content)
|
||||
.map(([x]) => x)
|
||||
.map(({text}) => text)
|
||||
.map(({ text }) => text)
|
||||
.map(text => text.trim())
|
||||
|
||||
const isEmpty =
|
||||
|
|
@ -47,10 +47,11 @@ export default function ({ inbox, currentWindow }) {
|
|||
text.replace(' ', ' / '))
|
||||
.map(text => ({
|
||||
style: 'grid',
|
||||
text}))
|
||||
text
|
||||
}))
|
||||
|
||||
setMessages(isEmpty ? [] : messages)
|
||||
}, [inbox, currentWindow])
|
||||
}, [inbox, currentWindow, prevMessages])
|
||||
|
||||
return (
|
||||
<section
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const fail = details => (
|
|||
<h1>
|
||||
Error
|
||||
</h1>
|
||||
{details.map(x => (<p>{x}</p>))}
|
||||
{details.map(x => (<p key={x}>{x}</p>))}
|
||||
<hr />
|
||||
<Link href='/'>
|
||||
Home
|
||||
|
|
@ -14,7 +14,7 @@ const fail = details => (
|
|||
|
|
||||
<a
|
||||
target='_blank'
|
||||
rel='noopener'
|
||||
rel='noopener noreferrer'
|
||||
href='https://github.com/He4eT/ifplayer/issues'>
|
||||
Report bug
|
||||
</a>
|
||||
|
|
@ -23,7 +23,7 @@ const fail = details => (
|
|||
|
||||
const loading = details => (
|
||||
<div class='status loading'>
|
||||
{details.map(x => (<div>{x}</div>))}
|
||||
{details.map(x => (<div key={x}>{x}</div>))}
|
||||
</div>
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export default function ({ inbox, currentWindow }) {
|
|||
const { incoming, clear } =
|
||||
parseInbox(inbox, currentWindow)
|
||||
|
||||
setMessages(clear
|
||||
setMessages(messages => clear
|
||||
? incoming
|
||||
: messages.concat(incoming))
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ export default function ({ inbox, currentWindow }) {
|
|||
? lastInput.offsetTop
|
||||
: textBufferEl.current.scrollHeight * 2
|
||||
}, 0)
|
||||
}, [inbox])
|
||||
}, [currentWindow, inbox])
|
||||
|
||||
const classes = [
|
||||
isFakeStatus(currentWindow)
|
||||
|
|
@ -85,7 +85,7 @@ export default function ({ inbox, currentWindow }) {
|
|||
tabindex='0'
|
||||
ref={textBufferEl}
|
||||
className={classes}>
|
||||
{messages.map(TextMessage)}
|
||||
{messages.map(TextMessage)}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ export const engineByFilename = filename => {
|
|||
|
||||
if (format) {
|
||||
return format.engine
|
||||
} else {
|
||||
throw new Error('Unsupported file type')
|
||||
}
|
||||
throw new Error('Unsupported file type')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ import { h } from 'preact'
|
|||
|
||||
export default function ({ themeEngine }) {
|
||||
const options = themeEngine.themes.map(theme => (
|
||||
<option value={theme}>
|
||||
{theme}
|
||||
<option
|
||||
key={theme}
|
||||
value={theme}>
|
||||
{theme}
|
||||
</option>))
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export default function () {
|
|||
<h1>
|
||||
<a
|
||||
target='_blank'
|
||||
rel='noopener'
|
||||
rel='noopener noreferrer'
|
||||
href='https://ifdb.org/'
|
||||
title='The Interactive Fiction Database'>
|
||||
IFDB
|
||||
|
|
@ -60,21 +60,21 @@ export default function () {
|
|||
<p>
|
||||
<a
|
||||
target='_blank'
|
||||
rel='noopener'
|
||||
rel='noopener noreferrer'
|
||||
href='https://ifdb.org/search?comp&sortby=awn&searchfor=series%3AInteractive+Fiction+Top+50+of+All+Time'>
|
||||
Every four years </a>, Victor Gijsbers puts
|
||||
together a list of the top 50 IF games of all time.
|
||||
|
||||
Here is an almost complete version of the <a
|
||||
target='_blank'
|
||||
rel='noopener'
|
||||
rel='noopener noreferrer'
|
||||
href='https://ifdb.org/viewcomp?id=1lv599reviaxvwo7'>
|
||||
list for 2019</a>:
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
{top2019.map(game => (
|
||||
<li>
|
||||
<li key={game[0]}>
|
||||
<GameEntry {...{
|
||||
...game
|
||||
}} />
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ export default function ({ themeEngine }) {
|
|||
<br />
|
||||
Source code can be found in this <a
|
||||
target='_blank'
|
||||
rel='noopener'
|
||||
rel='noopener noreferrer'
|
||||
href='https://github.com/He4eT/ifplayer'>
|
||||
repository
|
||||
</a>.
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export default () => (
|
|||
|
|
||||
<a
|
||||
target='_blank'
|
||||
rel='noopener'
|
||||
rel='noopener noreferrer'
|
||||
href='https://github.com/He4eT/ifplayer/issues'>
|
||||
Report bug
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const decode = encodedUrl => decodeURIComponent(encodedUrl)
|
|||
export default function ({
|
||||
setTheme, theme, encodedUrl, singleWindow
|
||||
}) {
|
||||
useEffect(() => setTheme(theme), [theme])
|
||||
useEffect(() => setTheme(theme), [setTheme, theme])
|
||||
|
||||
const [targetUrl, setTargetUrl] = useState(decode(encodedUrl))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue