From b14d7ab31977bb30667d316c2cf409789760c1b0 Mon Sep 17 00:00:00 2001 From: Mathias Schopmans Date: Mon, 3 Apr 2017 16:06:51 +0200 Subject: [PATCH] Add function to determine mobile viewport --- common/config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/config.js b/common/config.js index 3cdd778..0038f7f 100644 --- a/common/config.js +++ b/common/config.js @@ -34,4 +34,9 @@ const messages = { export const translate = (key) => (messages[key] || '-'); +export function isMobileViewport() { + const width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; + return width < 1200; +} + const formatRelease = (release) => moment(release, 'YYYY-MM-DD').format('MMM YYYY');