isHomeAndMobile reactive

This commit is contained in:
vjrj 2018-02-28 01:52:10 +01:00
parent 58c557ecb2
commit 7d5fe8f0ee
3 changed files with 7 additions and 7 deletions

View file

@ -2,8 +2,8 @@ import isMobile from 'ismobilejs';
import { isHome } from './location';
// https://github.com/ReactTraining/react-router/issues/184
export const isHomeAndMobile = isHome() && isMobile.any;
export const isNotHomeAndMobile = !isHomeAndMobile;
export const isHomeAndMobile = () => isHome() && isMobile.any;
export const isNotHomeAndMobile = () => !isHomeAndMobile();
export const isAnyMobile = isMobile.any;
// https://stackoverflow.com/questions/18625321/detect-webkit-browser-in-javascript
export const isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);