mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-08 00:10:24 +08:00
prettier colorSwitch WIP
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
import { Button, useColorMode } from "@chakra-ui/react";
|
||||
import { Switch, useColorMode } from "@chakra-ui/react";
|
||||
import React from "react";
|
||||
|
||||
type Props = {};
|
||||
|
||||
const ColorModeSwitch = (props: Props) => {
|
||||
const { colorMode, toggleColorMode } = useColorMode();
|
||||
return <Button onClick={toggleColorMode}>Toggle {colorMode === "light" ? "Dark" : "Light"}</Button>;
|
||||
return (
|
||||
<Switch
|
||||
onChange={toggleColorMode}
|
||||
defaultChecked={colorMode === "light"}
|
||||
checked={colorMode === "light"}
|
||||
size="lg"
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default ColorModeSwitch;
|
||||
|
||||
Reference in New Issue
Block a user