import { Links, Meta, Outlet, Scripts, ScrollRestoration, } from "@remix-run/react"; import React from "react"; export function Layout({ children }: { children: React.ReactNode }) { return ( {children}
Whoah
); } export default function App() { const message = isIOS() ? "Hey it's IOS!" : "Oh no" return
{message}
} function isIOS() { if (typeof window === "undefined") return false console.log("User Agent", window.navigator.userAgent) return [ 'iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod' ].includes(window.navigator.platform) // iPad on iOS 13 detection || (navigator.userAgent.includes("Mac") && "ontouchend" in document) } function iOSversion() { if (window.indexedDB) { return 'iOS 8 and up'; } if (window.SpeechSynthesisUtterance) { return 'iOS 7'; } if ((window as any).webkitAudioContext) { return 'iOS 6'; } if ((window as any).matchMedia) { return 'iOS 5'; } if (window.history && 'pushState' in window.history) { return 'iOS 4'; } return 'iOS 3 or earlier'; }