1
Fork 0
mirror of https://github.com/Steffo99/unisteffo.git synced 2024-11-21 23:44:22 +00:00
triennale-appunti-steffo/components/theme-switcher.tsx

20 lines
668 B
TypeScript
Raw Permalink Normal View History

2022-02-04 05:16:29 +00:00
import { Form } from "@steffo/bluelib-react";
import { createContext, useContext } from "react";
export const Theme: any = createContext(["sophon", () => console.error("Setting theme outside of context")])
export const ThemeSwitcher = () => {
const [theme, setTheme] = useContext(Theme)
return (
<Form>
<Form.Select label="Tema" value={theme} onSimpleChange={setTheme} options={{
"Royal Blue": "royalblue",
"The Sophonity": "sophon",
"Sheet of Paper": "paper",
"Hacker Terminal": "hacker",
"Gestione Amber": "amber",
}}/>
</Form>
)
}