{"size": 1136, "ext": "js", "max_stars_repo_path": "lib/index.js", "max_stars_repo_name": "CalvinKorver/pownow-client", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/index.js", "max_issues_repo_name": "CalvinKorver/pownow-client", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/index.js", "max_forks_repo_name": "CalvinKorver/pownow-client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.8181818182, "max_line_length": 68, "alphanum_fraction": 0.6241197183}
import MobileDetect from "mobile-detect";
import { Responsive } from "semantic-ui-react"

export const ENTER_DURATION=.5
export const EXIT_DURATION=.2

export const DEFAULT_VARIANTS = {
    initial: { opacity: 0 },
    enter: { opacity: 1, transition: { duration: ENTER_DURATION } },
    exit: { opacity: 0, transition: { duration: EXIT_DURATION } }
  }

export const INDEX_VARIANTS = {
  initial: { opacity: 1 },
  enter: { opacity: 1},
  exit: { opacity: 1}
}

export const getWidthFactory = isMobileFromSSR => () => {
  const isSSR = typeof window === "undefined";
  const ssrValue = isMobileFromSSR
      ? Responsive.onlyMobile.maxWidth
      : Responsive.onlyTablet.minWidth;

  console.log(ssrValue)
  return isSSR ? ssrValue : window.innerWidth;
};

export const handleMobile = (req) => {
  const md = new MobileDetect(req.headers["user-agent"]);
  const isMobileFromSSR = !!md.mobile();

  return {
      props: {
          isMobileFromSSR,
          deviceInfo: {
              mobile: md.mobile(),
              tablet: md.tablet(),
              os: md.os(),
              userAgent: md.userAgent()
          }
      }
  }
}