Skip to content

Instantly share code, notes, and snippets.

@polluterofminds
Created October 26, 2022 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polluterofminds/7b64baa030c4691478d927fdc41e3bba to your computer and use it in GitHub Desktop.
Save polluterofminds/7b64baa030c4691478d927fdc41e3bba to your computer and use it in GitHub Desktop.
Appjections Mobile View
import React, { useEffect, useState } from 'react'
import InstallScreen from "./InstallScreen";
import AppContainer from "./AppContainer";
const MobileView = () => {
const [standaloneMode, setStandaloneMode] = useState(false);
useEffect(() => {
let standalone = false;
if (window.matchMedia("(display-mode: standalone)").matches) {
standalone = true;
}
setStandaloneMode(standalone);
}, []);
if(standaloneMode) {
return (
<AppContainer />
)
} else {
return (
<InstallScreen />
)
}
}
export default MobileView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment