drop.chapril.org-firefoxsend/app/pages/signin/index.js

56 lines
1.8 KiB
JavaScript
Raw Normal View History

2018-07-31 20:09:18 +02:00
const html = require('choo/html');
const assets = require('../../../common/assets');
const title = require('../../templates/title');
module.exports = function(state, emit) {
return html`
<div class="page signInPage">
2018-09-01 00:15:25 +02:00
<a href="/" class="goBackButton">
<img src="${assets.get('back-arrow.svg')}"/>
2018-07-31 20:09:18 +02:00
</a>
${title(state)}
<div class="signIn__info flexible">
${state.translate('accountBenefitTitle')}
<ul>
<li>${state.translate('accountBenefitMultiFile')}</li>
<li>${state.translate('accountBenefitLargeFiles')}</li>
<li>${state.translate('accountBenefitExpiry')}</li>
<li>${state.translate('accountBenefitSync')}</li>
<li>${state.translate('accountBenefitNotify')}</li>
<li>${state.translate('accountBenefitMore')}</li>
</ul>
</div>
<div class="signIn__form flexible">
<img class="signIn__firefoxLogo"
src="${assets.get('firefox_logo-only.svg')}"
width=56 height=56
alt="Firefox logo"/>
<div class="signIn__emailLabel">
${state.translate('signInEmailEnter')}
</div>
${state.translate('signInContinueMessage')}
<form
2018-08-03 21:24:41 +02:00
onsubmit=${submitEmail}
2018-07-31 20:09:18 +02:00
data-no-csrf>
<input
type="text"
class="signIn__emailInput"
placeholder=${state.translate('emailEntryPlaceholder')}/>
<input
class='noDisplay'
id="emailSubmit"
type="submit"/>
</form>
</div>
<label class="btn" for="emailSubmit">
${state.translate('signInContinueButton')}
</label>
</div>
`;
2018-08-03 21:24:41 +02:00
function submitEmail(event) {
event.preventDefault();
2018-09-01 00:15:25 +02:00
emit('login');
2018-08-03 21:24:41 +02:00
}
2018-07-31 20:09:18 +02:00
};