feat: cleanup
This commit is contained in:
1 parent
80dee67c08
commit
dd488fecb4
1 file changed
+1
-15
@@ -1,8 +1,7 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
// import "./index.css";
|
import "./index.css";
|
||||||
import { IconButton } from "@mui/material";
|
import { IconButton } from "@mui/material";
|
||||||
import SunAndMoonIcon from "./SunAndMoonIcon";
|
import SunAndMoonIcon from "./SunAndMoonIcon";
|
||||||
// import SunAndMoonIcon from "./SunAndMoonIcon";
|
|
||||||
|
|
||||||
const ThemeSwitch = () => {
|
const ThemeSwitch = () => {
|
||||||
const [currentTheme, setCurrentTheme] = useState("light");
|
const [currentTheme, setCurrentTheme] = useState("light");
|
||||||
@@ -11,7 +10,6 @@ const ThemeSwitch = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.body.setAttribute("data-theme", currentTheme);
|
document.body.setAttribute("data-theme", currentTheme);
|
||||||
console.log(currentTheme);
|
|
||||||
}, [currentTheme]);
|
}, [currentTheme]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -27,18 +25,6 @@ const ThemeSwitch = () => {
|
|||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
// "& .sun-and-moon": {
|
|
||||||
// transformOrigin: "center",
|
|
||||||
// },
|
|
||||||
// "& .sun": {
|
|
||||||
// fill: "var(--icon-fill)",
|
|
||||||
// transition: "transform 0.5s ease",
|
|
||||||
// ...(currentTheme === "dark" && { transform: "scale(1.75)" }),
|
|
||||||
// },
|
|
||||||
// "& .moon > circle": {
|
|
||||||
// transform: currentTheme === "dark" ? "translateX(-7px)" : "none",
|
|
||||||
// transition: "transform 0.25s ease",
|
|
||||||
// },
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<SunAndMoonIcon />
|
<SunAndMoonIcon />
|
||||||
|
|||||||
Reference in new issue
Block a user