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:
Tom Moor
2021-04-17 10:40:39 -07:00
parent c46a032f0b
commit b2d703bee4
10 changed files with 62 additions and 18 deletions

View 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;
}