Extract themeEngine

This commit is contained in:
He4eT 2021-02-24 23:35:40 +05:00
commit c9f42e497a
5 changed files with 30 additions and 28 deletions

View file

@ -1,15 +1,16 @@
import { h } from 'preact'
export default function ({ themeList, currentTheme, setTheme }) {
const options = themeList.map(theme => (
export default function ({ themeEngine }) {
const options = themeEngine.themes.map(theme => (
<option value={theme}>
{theme}
</option>))
return (
<select
value={currentTheme}
onChange={({ target }) => setTheme(target.value)}>
value={themeEngine.currentTheme}
onChange={({ target }) =>
themeEngine.setTheme(target.value)}>
{options}
</select>)
}

View file

@ -9,7 +9,6 @@ const INITIAL_STATUS = {
}
export default function ({url}) {
console.log(123, url)
const [status, setStatus] = useState(INITIAL_STATUS)
const [vm, setVM] = useState(null)