fix: Improved mobile styling
fix: Severla context menus miss-positioned fix: Search filters not large enough on mobile fix: Deep black background on mobile to match native apps fix: Sticky document header allowing horizontal scrolling on mobile
This commit is contained in:
20
app/hooks/useMediaQuery.js
Normal file
20
app/hooks/useMediaQuery.js
Normal file
@ -0,0 +1,20 @@
|
||||
// @flow
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
export default function useMediaQuery(query: string): boolean {
|
||||
const [matches, setMatches] = useState<boolean>(false);
|
||||
|
||||
useEffect(() => {
|
||||
const media = window.matchMedia(query);
|
||||
if (media.matches !== matches) {
|
||||
setMatches(media.matches);
|
||||
}
|
||||
const listener = () => {
|
||||
setMatches(media.matches);
|
||||
};
|
||||
media.addListener(listener);
|
||||
return () => media.removeListener(listener);
|
||||
}, [matches, query]);
|
||||
|
||||
return matches;
|
||||
}
|
Reference in New Issue
Block a user