mirror of
https://github.com/luckjiawei/podux.git
synced 2026-12-02 10:16:50 +00:00
💄 Fix Layout
This commit is contained in:
1 parent
90f7bc28e3
commit
99032f219b
1 file changed
+2
-2
@@ -24,10 +24,10 @@ function useIsMobile() {
|
||||
navigator.userAgent,
|
||||
);
|
||||
|
||||
const [isSmall, setIsSmall] = useState(() => window.matchMedia("(max-width: 639px)").matches);
|
||||
const [isSmall, setIsSmall] = useState(() => window.matchMedia("(max-width: 760px)").matches);
|
||||
|
||||
useEffect(() => {
|
||||
const mq = window.matchMedia("(max-width: 639px)");
|
||||
const mq = window.matchMedia("(max-width: 760px)");
|
||||
const handler = (e: MediaQueryListEvent) => setIsSmall(e.matches);
|
||||
mq.addEventListener("change", handler);
|
||||
return () => mq.removeEventListener("change", handler);
|
||||
|
||||
Reference in new issue
Block a user