From 5ab6c3304b4a2d055767b8195fac9c9eec776d16 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Tue, 9 Apr 2024 16:32:41 +0100 Subject: fix(web): Fix the toggle theme button allowing clicks from anywhere in the dropdown item --- .../components/dashboard/sidebar/SidebarProfileOptions.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'apps/web/components/dashboard') diff --git a/apps/web/components/dashboard/sidebar/SidebarProfileOptions.tsx b/apps/web/components/dashboard/sidebar/SidebarProfileOptions.tsx index bf56b805..3fe4d52f 100644 --- a/apps/web/components/dashboard/sidebar/SidebarProfileOptions.tsx +++ b/apps/web/components/dashboard/sidebar/SidebarProfileOptions.tsx @@ -1,5 +1,6 @@ "use client"; +import { useToggleTheme } from "@/components/theme-provider"; import { Button } from "@/components/ui/button"; import { DropdownMenu, @@ -13,28 +14,29 @@ import { signOut } from "next-auth/react"; import { useTheme } from "next-themes"; function DarkModeToggle() { - const { theme, setTheme } = useTheme(); + const { theme } = useTheme(); let comp; if (theme == "dark") { comp = ( - + ); } else { comp = ( - + ); } return {comp}; } export default function SidebarProfileOptions() { + const toggleTheme = useToggleTheme(); return ( @@ -43,7 +45,7 @@ export default function SidebarProfileOptions() { - +