const getOs = () => {
  if (navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
    return "iOS";
  }
  if (navigator.userAgent.indexOf("MSIE") > 0) {
    return "MSIE";
  }
  if (navigator.userAgent.indexOf("Firefox") > 0) {
    return "Firefox";
  }
  if (navigator.userAgent.indexOf("Chrome") > 0) {
    return "Chrome";
  }
  if (navigator.userAgent.indexOf("Safari") > 0) {
    return "Safari";
  }
  if (navigator.userAgent.indexOf("Camino") > 0) {
    return "Camino";
  }
  if (navigator.userAgent.indexOf("Gecko/") > 0) {
    return "Gecko";
  }
};

export const isChrome = () => {
  return getOs() === "Chrome";
};

export const isFirefox = () => {
  return getOs() === "Firefox";
};

export const isIE = () => {
  return getOs() === "MSIE";
};

export const isSafari = () => {
  return getOs() === "Safari";
};

export const isIOS = () => {
  return getOs() === "iOS";
};
