Skip to content

Commit 1afe0fd

Browse files
committed
refactore: remove WhatTheme hook
1 parent 793570c commit 1afe0fd

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/lib/utils.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,6 @@
1-
import { useTheme } from "@/components/theme-provider";
21
import { clsx } from "clsx";
3-
import { useEffect } from "react";
42
import { twMerge } from "tailwind-merge";
53

64
export function cn(...inputs) {
75
return twMerge(clsx(inputs));
86
}
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

Comments
 (0)