Store the UI theme in the LocalStorage

This commit is contained in:
He4eT 2021-03-24 17:09:57 +05:00
commit 7f143925ac
6 changed files with 28 additions and 25 deletions

View file

@ -1,5 +1,5 @@
import { h, render } from 'preact'
import { Route, Router, Redirect, Switch } from 'wouter-preact'
import { Route, Router, Switch } from 'wouter-preact'
import {
useHashLocation,
@ -34,17 +34,16 @@ function App () {
themeEngine
}} />
</Route>
<Route path='/games/:theme'>
{params => <GamesView {...{
<Route path='/games/'>
<GamesView />
</Route>
<Route path='/play/:encodedUrl'>
{params => <PlayerView {...{
...themeEngine,
...params
}} />}
</Route>
<Route path='/games'>
<Redirect
to={`/games/${themeEngine.currentTheme}/`} />
</Route>
<Route path='/play/:theme/:encodedUrl'>
<Route path='/play/:encodedUrl/:theme'>
{params => <PlayerView {...{
...themeEngine,
...params