mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-05 09:27:23 +00:00
Store the UI theme in the LocalStorage
This commit is contained in:
parent
e09705cf23
commit
7f143925ac
6 changed files with 28 additions and 25 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import { h } from 'preact'
|
||||
import { useEffect } from 'preact/hooks'
|
||||
import { Link } from 'wouter-preact'
|
||||
|
||||
import GameEntry from
|
||||
|
|
@ -15,9 +14,7 @@ const tutorialGame = {
|
|||
url: 'http://mirror.ifarchive.org/if-archive/games/zcode/dreamhold.z8'
|
||||
}
|
||||
|
||||
export default function ({ setTheme, theme }) {
|
||||
useEffect(() => setTheme(theme), [theme])
|
||||
|
||||
export default function () {
|
||||
return (
|
||||
<main className='view games'>
|
||||
|
||||
|
|
@ -32,7 +29,7 @@ export default function ({ setTheme, theme }) {
|
|||
|
||||
<p>
|
||||
Choose one or <Link href='/'>
|
||||
go back </Link>.
|
||||
go back</Link>.
|
||||
</p>
|
||||
|
||||
<h3>
|
||||
|
|
@ -48,8 +45,7 @@ export default function ({ setTheme, theme }) {
|
|||
<ul>
|
||||
<li>
|
||||
<GameEntry {...{
|
||||
...tutorialGame,
|
||||
theme
|
||||
...tutorialGame
|
||||
}} />
|
||||
</li>
|
||||
</ul>
|
||||
|
|
@ -77,8 +73,7 @@ export default function ({ setTheme, theme }) {
|
|||
{top2019.map(game => (
|
||||
<li>
|
||||
<GameEntry {...{
|
||||
...game,
|
||||
theme
|
||||
...game
|
||||
}} />
|
||||
</li>
|
||||
))}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ export default function ({ themeEngine }) {
|
|||
</h3>
|
||||
|
||||
<p>
|
||||
<Link href={`/#/games/${themeEngine.currentTheme}`}>
|
||||
<Link href={'/#/games/'}>
|
||||
IFDB games
|
||||
</Link>
|
||||
</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue