chore(ui): shadcn bileşenleri, use-mobile ve ESLint ayarı

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-05 01:35:10 +03:00
parent 1941b72cc6
commit 4f41c0f668
27 changed files with 2736 additions and 6 deletions
+22
View File
@@ -0,0 +1,22 @@
import { useSyncExternalStore } from "react";
const MOBILE_BREAKPOINT = 768;
const QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`;
function subscribe(onChange: () => void) {
const mql = window.matchMedia(QUERY);
mql.addEventListener("change", onChange);
return () => mql.removeEventListener("change", onChange);
}
/**
* Ekran mobil genişlikte mi (< 768px)? Sunucuda ve hydration sırasında `false` döner,
* ardından tarayıcı değerine geçer (effect içinde setState yok).
*/
export function useIsMobile() {
return useSyncExternalStore(
subscribe,
() => window.matchMedia(QUERY).matches,
() => false,
);
}