mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-23 04:21:51 -07:00
Rework theme provider to provide the actual Theme object throughtout the app, in addition to the name
Split name out of the Theme struct to simplify custom theme saving/reading
This commit is contained in:
parent
8d3c51eb3d
commit
1c605c3c1f
6 changed files with 169 additions and 161 deletions
|
|
@ -12,7 +12,6 @@ import { themes, type Theme } from "~/styles/themes.css"
|
|||
|
||||
export default function ThemeHelper() {
|
||||
const initialTheme = {
|
||||
name: "custom",
|
||||
bg: "#1e1816",
|
||||
bgSecondary: "#2f2623",
|
||||
bgTertiary: "#453733",
|
||||
|
|
@ -36,9 +35,6 @@ export default function ThemeHelper() {
|
|||
console.log(custom)
|
||||
try {
|
||||
const theme = JSON.parse(custom) as Theme
|
||||
if (theme.name !== "custom") {
|
||||
throw new Error("theme name must be 'custom'")
|
||||
}
|
||||
console.log(theme)
|
||||
setCustomTheme(theme)
|
||||
} catch(err) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue