From 1afe0fdc76743a9a2aeb24e6b7a0700133a23167 Mon Sep 17 00:00:00 2001 From: No0ne003 Date: Fri, 31 May 2024 11:04:39 +0100 Subject: [PATCH] refactore: remove WhatTheme hook --- src/lib/utils.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/lib/utils.js b/src/lib/utils.js index 5a7026b..378ccef 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -1,25 +1,6 @@ -import { useTheme } from "@/components/theme-provider"; import { clsx } from "clsx"; -import { useEffect } from "react"; import { twMerge } from "tailwind-merge"; export function cn(...inputs) { return twMerge(clsx(inputs)); } - -// know what theme is set and set theme -export default function useWhatTheme() { - const { theme, setTheme } = useTheme(); - - useEffect(() => { - if (theme === "system") { - setTheme( - window.matchMedia("(prefers-color-scheme: dark)")?.matches - ? "dark" - : "light", - ); - } - }); - - return { theme }; -}