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