forked from external-repos/squoosh
Apply suggestions from code review
Co-authored-by: Surma <surma@surma.dev>
This commit is contained in:
@@ -52,10 +52,7 @@ interface State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default class Intro extends Component<Props, State> {
|
export default class Intro extends Component<Props, State> {
|
||||||
state: State = {
|
state: State = {};
|
||||||
deferredPrompt: undefined,
|
|
||||||
installSource: undefined,
|
|
||||||
};
|
|
||||||
private fileInput?: HTMLInputElement;
|
private fileInput?: HTMLInputElement;
|
||||||
private installButton?: HTMLButtonElement;
|
private installButton?: HTMLButtonElement;
|
||||||
|
|
||||||
@@ -137,10 +134,7 @@ export default class Intro extends Component<Props, State> {
|
|||||||
deferredPrompt.prompt();
|
deferredPrompt.prompt();
|
||||||
|
|
||||||
// Wait for the user to accept or dismiss the install prompt
|
// Wait for the user to accept or dismiss the install prompt
|
||||||
const response = await deferredPrompt.userChoice;
|
const {outcome} = await deferredPrompt.userChoice;
|
||||||
|
|
||||||
// Get the outcome and log it
|
|
||||||
const outcome = response.outcome;
|
|
||||||
ga('send', 'event', 'pwa-install', installSource, outcome);
|
ga('send', 'event', 'pwa-install', installSource, outcome);
|
||||||
|
|
||||||
// If the prompt was dismissed, clear the installSource.
|
// If the prompt was dismissed, clear the installSource.
|
||||||
|
|||||||
@@ -181,13 +181,21 @@
|
|||||||
background: #fff;
|
background: #fff;
|
||||||
border: 1px solid #e8e8e8;
|
border: 1px solid #e8e8e8;
|
||||||
|
|
||||||
margin-top: 1em;
|
|
||||||
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 14px;
|
padding: 14px;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
top: 1rem;
|
||||||
|
right: 1rem;
|
||||||
display: none;
|
display: none;
|
||||||
|
opacity: 0;
|
||||||
|
|
||||||
|
animation: fade-in .3s linear 1s forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fade-in {
|
||||||
|
to {opacity: 1;}
|
||||||
}
|
}
|
||||||
|
|
||||||
.related-links {
|
.related-links {
|
||||||
|
|||||||
Reference in New Issue
Block a user