@deep-foundation/deepcase
Version:
[](https://gitpod.io/#https://github.com/deep-foundation/deepcase) [](https://discord.gg/deep-
12 lines • 721 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { useColorMode, useColorModeValue, IconButton, } from "@chakra-ui/react";
import { SunIcon, MoonIcon } from '@chakra-ui/icons';
export const ColorModeSwitcher = () => {
const text = useColorModeValue("dark", "light");
const SwitchIcon = useColorModeValue(MoonIcon, SunIcon);
const { colorMode, toggleColorMode } = useColorMode();
return (_jsx(IconButton, { sx: {
position: 'fixed', right: 0, top: 0
}, size: "md", fontSize: "lg", variant: "ghost", color: "current", marginLeft: "2", onClick: toggleColorMode, icon: _jsx(SwitchIcon, {}), "aria-label": `Switch to ${text} mode` }));
};
//# sourceMappingURL=color-mode-toggle.js.map