react-pwa-install-prompt
Advanced tools
Comparing version 1.0.0 to 1.0.2
{ | ||
"name": "react-pwa-install-prompt", | ||
"version": "1.0.0", | ||
"version": "1.0.2", | ||
"description": "A react hook to prompt the install of your PWA in supported browers (Chrome desktop & mobile)", | ||
@@ -39,3 +39,2 @@ "author": "eric-edouard", | ||
"@typescript-eslint/parser": "^2.26.0", | ||
"microbundle-crl": "^0.13.10", | ||
"babel-eslint": "^10.0.3", | ||
@@ -54,2 +53,3 @@ "cross-env": "^7.0.2", | ||
"gh-pages": "^2.2.0", | ||
"microbundle-crl": "^0.13.10", | ||
"npm-run-all": "^4.1.5", | ||
@@ -56,0 +56,0 @@ "prettier": "^2.0.4", |
@@ -24,6 +24,15 @@ # react-pwa-install-prompt | ||
const renderInstallButton = () => { | ||
const onClickInstall = async () => { | ||
const didInstall = await promptInstall() | ||
if (didInstall) { | ||
// User accepted PWA install | ||
} | ||
} | ||
const renderInstallButton = () => { | ||
if (isInstallPromptSupported && isStandalone) | ||
return ( | ||
<button onClick={promptInstall}>Prompt PWA Install</button> | ||
<button onClick={onClickInstall}>Prompt PWA Install</button> | ||
) | ||
@@ -33,3 +42,3 @@ return null | ||
return (<div style={{marginLeft: '2em'}}> | ||
return (<div> | ||
<h2>PWA Infos</h2> | ||
@@ -36,0 +45,0 @@ <p>Is Install Prompt Supported ? {isInstallPromptSupported ? 'true' : 'false'}</p> |
15711
56