Skip to content

Commit d1f7897

Browse files
committed
toggle btn fixed
1 parent 2256120 commit d1f7897

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/components/Page/partial/Navbar/ThemeToggle.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ const ThemeToggle = () => {
1919
<div className={`${night ? 'bg-gradient-to-r from-gray-900 to-gray-800' : "bg-gradient-to-r from-gray-300 to-white"} w-[3.5em] h-[36px] bg-white rounded-full relative border-[2px] border-gray-400`}
2020
onClick={() => {
2121
setNightMode(!night)
22-
localStorage.setItem("dark", !night);
22+
localStorage.setItem("dark", JSON.stringify(!night));
2323
}}>
2424
<div className={`transition-all duration-300 ease-in-out absolute w-[28px] h-[28px] bg-gray-100 shadow-sm ${night ? "top-[.1em] translate-x-[1.75em] shadow-black" : " shadow-gray-400 top-[.1em] translate-x-[.1em]"} rounded-full`}>
25-
<div className={`transition-all duration-300 ease-in-out absolute w-[26px] h-[26px] bg-gray-200 top-[3%] left-[7%] rounded-full flex items-center justify-center`}>
25+
<div className={`transition-all duration-300 ease-in-out absolute w-[26px] h-[26px] bg-gray-200 top-[3%] left-[1%] rounded-full flex items-center justify-center`}>
2626
{night ? <Moon className={`text-gray-800 scale-[.8]`}/> : <Sun className={`text-gray-500 scale-[.8]`}/>}
2727
</div>
2828
</div>

0 commit comments

Comments
 (0)