implemented amplitude metrics (#1141)
This commit is contained in:
parent
1a483cad55
commit
9b37e92a81
26 changed files with 774 additions and 528 deletions
|
@ -1,8 +1,9 @@
|
|||
/* global LIMITS */
|
||||
const html = require('choo/html');
|
||||
const { bytes, platform } = require('../utils');
|
||||
const { canceledSignup, submittedSignup } = require('../metrics');
|
||||
|
||||
module.exports = function() {
|
||||
module.exports = function(trigger) {
|
||||
return function(state, emit, close) {
|
||||
const hidden = platform() === 'android' ? 'hidden' : '';
|
||||
let submitting = false;
|
||||
|
@ -37,7 +38,7 @@ module.exports = function() {
|
|||
<button
|
||||
class="my-4 text-blue hover:text-blue-dark focus:text-blue-darker font-medium"
|
||||
title="${state.translate('deletePopupCancel')}"
|
||||
onclick=${close}>${state.translate('deletePopupCancel')}
|
||||
onclick=${cancel}>${state.translate('deletePopupCancel')}
|
||||
</button>
|
||||
</send-signup-dialog>`;
|
||||
|
||||
|
@ -50,6 +51,11 @@ module.exports = function() {
|
|||
return a.length === 2 && a.every(s => s.length > 0);
|
||||
}
|
||||
|
||||
function cancel(event) {
|
||||
canceledSignup({ trigger });
|
||||
close(event);
|
||||
}
|
||||
|
||||
function submitEmail(event) {
|
||||
event.preventDefault();
|
||||
if (submitting) {
|
||||
|
@ -59,6 +65,7 @@ module.exports = function() {
|
|||
|
||||
const el = document.getElementById('email-input');
|
||||
const email = el.value;
|
||||
submittedSignup({ trigger });
|
||||
emit('login', emailish(email) ? email : null);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue