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