hide signup promo when logged in

This commit is contained in:
Danny Coates 2018-08-31 15:15:25 -07:00
parent 85185d048c
commit 00550872d7
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
2 changed files with 6 additions and 14 deletions

View File

@ -2,16 +2,13 @@ const html = require('choo/html');
const assets = require('../../../common/assets');
const title = require('../../templates/title');
// eslint-disable-next-line no-unused-vars
module.exports = function(state, emit) {
return html`
<div class="page signInPage">
<a href="/" class="goBackButton">
<img src="${assets.get('back-arrow.svg')}"/>
<a href="/" class="goBackButton">
<img src="${assets.get('back-arrow.svg')}"/>
</a>
${title(state)}
<div class="signIn__info flexible">
${state.translate('accountBenefitTitle')}
<ul>
@ -23,19 +20,15 @@ module.exports = function(state, emit) {
<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
onsubmit=${submitEmail}
data-no-csrf>
@ -43,24 +36,20 @@ module.exports = function(state, emit) {
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>
`;
function submitEmail(event) {
event.preventDefault();
//TODO: hook up fxA onboarding
emit('login');
}
};

View File

@ -1,6 +1,9 @@
const html = require('choo/html');
module.exports = function(state) {
if (state.user.loggedIn) {
return null;
}
return html`
<div class="signupPromo">
<div class="signupPromo__title">${state.translate('signInPromoText')}</div>