This commit is contained in:
hamid
2026-06-16 01:32:43 +03:30
commit 69bbd28bb0
298 changed files with 24728 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import { useCallback } from 'react';
import { useAppStore } from '../store';
/**
* Returns event handler to toggle Dark/Light modes
* @returns {function} calling this event toggles dark/light mode
*/
export function useEventSwitchDarkMode() {
const [state, dispatch] = useAppStore();
return useCallback(() => {
dispatch({
type: 'DARK_MODE',
payload: !state.darkMode,
});
}, [state, dispatch]);
}