This commit is contained in:
daniel31x13
2023-11-24 03:06:33 -05:00
parent 828e8eae2e
commit b8b6fe24bc
15 changed files with 121 additions and 99 deletions
+1 -13
View File
@@ -10,7 +10,6 @@ import SearchBar from "@/components/SearchBar";
import useAccountStore from "@/store/account";
import ProfilePhoto from "@/components/ProfilePhoto";
import useModalStore from "@/store/modals";
import { useTheme } from "next-themes";
import useWindowDimensions from "@/hooks/useWindowDimensions";
import ToggleDarkMode from "./ToggleDarkMode";
@@ -23,16 +22,6 @@ export default function Navbar() {
const router = useRouter();
const { theme, setTheme } = useTheme();
const handleToggle = () => {
if (theme === "dark") {
setTheme("light");
} else {
setTheme("dark");
}
};
const [sidebar, setSidebar] = useState(false);
const { width } = useWindowDimensions();
@@ -106,9 +95,8 @@ export default function Navbar() {
href: "/settings/account",
},
{
name: `Switch to ${theme === "light" ? "Dark" : "Light"}`,
name: `Switch to ${"light" ? "Dark" : "Light"}`,
onClick: () => {
handleToggle();
setProfileDropdown(!profileDropdown);
},
},