From e260ab46cb370c3a74797f86957b5fecefda9188 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Tue, 8 Aug 2017 17:50:29 -0700 Subject: [PATCH] Implement utility helper for checking viewport size in js --- ui/lib/is-mobile-view.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ui/lib/is-mobile-view.js diff --git a/ui/lib/is-mobile-view.js b/ui/lib/is-mobile-view.js new file mode 100644 index 000000000..8a8591c1a --- /dev/null +++ b/ui/lib/is-mobile-view.js @@ -0,0 +1,5 @@ +// Checks if viewport at invoke time fits mobile dimensions +// isMobileView :: () => Bool +const isMobileView = () => window.matchMedia("screen and (max-width: 575px)").matches + +module.exports = isMobileView \ No newline at end of file