initial commit

This commit is contained in:
maotovisk 2025-11-07 13:36:00 -03:00
commit 2e0cbc254c
174 changed files with 27742 additions and 0 deletions

View file

@ -0,0 +1,21 @@
import { useSyncExternalStore } from 'react';
const MOBILE_BREAKPOINT = 768;
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
function mediaQueryListener(callback: (event: MediaQueryListEvent) => void) {
mql.addEventListener('change', callback);
return () => {
mql.removeEventListener('change', callback);
};
}
function isSmallerThanBreakpoint() {
return mql.matches;
}
export function useIsMobile() {
return useSyncExternalStore(mediaQueryListener, isSmallerThanBreakpoint);
}