From e260ab46cb370c3a74797f86957b5fecefda9188 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Tue, 8 Aug 2017 17:50:29 -0700 Subject: 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 (limited to '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 -- cgit From e7b3ef0708290a81dad5c469adaa6fab3f1c45b5 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 29 Aug 2017 12:20:48 -0230 Subject: Lint fixes --- ui/lib/is-mobile-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/lib/is-mobile-view.js') diff --git a/ui/lib/is-mobile-view.js b/ui/lib/is-mobile-view.js index 8a8591c1a..78fd6cb54 100644 --- a/ui/lib/is-mobile-view.js +++ b/ui/lib/is-mobile-view.js @@ -1,5 +1,5 @@ // Checks if viewport at invoke time fits mobile dimensions // isMobileView :: () => Bool -const isMobileView = () => window.matchMedia("screen and (max-width: 575px)").matches +const isMobileView = () => window.matchMedia('screen and (max-width: 575px)').matches -module.exports = isMobileView \ No newline at end of file +module.exports = isMobileView -- cgit