1
Fork 0
mirror of https://github.com/Steffo99/unisteffo.git synced 2024-11-21 15:34:21 +00:00
triennale-appunti-steffo/components/theme-switcher.tsx
2022-02-04 06:16:29 +01:00

20 lines
No EOL
668 B
TypeScript

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>
)
}