We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 793570c commit 1afe0fdCopy full SHA for 1afe0fd
src/lib/utils.js
@@ -1,25 +1,6 @@
1
-import { useTheme } from "@/components/theme-provider";
2
import { clsx } from "clsx";
3
-import { useEffect } from "react";
4
import { twMerge } from "tailwind-merge";
5
6
export function cn(...inputs) {
7
return twMerge(clsx(inputs));
8
}
9
-
10
-// know what theme is set and set theme
11
-export default function useWhatTheme() {
12
- const { theme, setTheme } = useTheme();
13
14
- useEffect(() => {
15
- if (theme === "system") {
16
- setTheme(
17
- window.matchMedia("(prefers-color-scheme: dark)")?.matches
18
- ? "dark"
19
- : "light",
20
- );
21
- }
22
- });
23
24
- return { theme };
25
-}
0 commit comments