mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
New site, new svgs and bug fixes
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import React from "react";
|
||||
import { useColorMode, useColorModeValue } from "@chakra-ui/react";
|
||||
import { IoMoonOutline, IoSunnyOutline } from "react-icons/io5";
|
||||
import Item from "./item";
|
||||
|
||||
const Index = () => {
|
||||
const { colorMode, toggleColorMode } = useColorMode();
|
||||
const iconChange = useColorModeValue(IoSunnyOutline, IoMoonOutline);
|
||||
const theme = useColorModeValue("Light", "Dark");
|
||||
|
||||
function toggleTheme() {
|
||||
toggleColorMode();
|
||||
}
|
||||
|
||||
return (
|
||||
<Item icon={iconChange} onClick={toggleTheme}>
|
||||
{theme}
|
||||
</Item>
|
||||
);
|
||||
};
|
||||
|
||||
export default Index;
|
||||
Reference in New Issue
Block a user