mirror of
https://git.aramjonghu.dev/AramJonghu/aramjonghu-site.git
synced 2026-09-06 07:33:29 +02:00
TS7 upgrade + write to TS over JS
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { getInitialTheme, applyTheme, toggleTheme } from "../utils/theme";
|
||||
|
||||
export function useTheme() {
|
||||
const [theme, setTheme] = useState(getInitialTheme);
|
||||
interface UseThemeReturn {
|
||||
theme: string;
|
||||
toggleTheme: () => void;
|
||||
}
|
||||
|
||||
export function useTheme(): UseThemeReturn {
|
||||
const [theme, setTheme] = useState<string>(getInitialTheme);
|
||||
|
||||
useEffect(() => {
|
||||
applyTheme(theme);
|
||||
Reference in New Issue
Block a user