hide signup promo when logged in
This commit is contained in:
parent
85185d048c
commit
00550872d7
2 changed files with 6 additions and 14 deletions
|
@ -2,16 +2,13 @@ const html = require('choo/html');
|
||||||
const assets = require('../../../common/assets');
|
const assets = require('../../../common/assets');
|
||||||
const title = require('../../templates/title');
|
const title = require('../../templates/title');
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
module.exports = function(state, emit) {
|
module.exports = function(state, emit) {
|
||||||
return html`
|
return html`
|
||||||
|
|
||||||
<div class="page signInPage">
|
<div class="page signInPage">
|
||||||
<a href="/" class="goBackButton">
|
<a href="/" class="goBackButton">
|
||||||
<img src="${assets.get('back-arrow.svg')}"/>
|
<img src="${assets.get('back-arrow.svg')}"/>
|
||||||
</a>
|
</a>
|
||||||
${title(state)}
|
${title(state)}
|
||||||
|
|
||||||
<div class="signIn__info flexible">
|
<div class="signIn__info flexible">
|
||||||
${state.translate('accountBenefitTitle')}
|
${state.translate('accountBenefitTitle')}
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -23,19 +20,15 @@ module.exports = function(state, emit) {
|
||||||
<li>${state.translate('accountBenefitMore')}</li>
|
<li>${state.translate('accountBenefitMore')}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="signIn__form flexible">
|
<div class="signIn__form flexible">
|
||||||
|
|
||||||
<img class="signIn__firefoxLogo"
|
<img class="signIn__firefoxLogo"
|
||||||
src="${assets.get('firefox_logo-only.svg')}"
|
src="${assets.get('firefox_logo-only.svg')}"
|
||||||
width=56 height=56
|
width=56 height=56
|
||||||
alt="Firefox logo"/>
|
alt="Firefox logo"/>
|
||||||
|
|
||||||
<div class="signIn__emailLabel">
|
<div class="signIn__emailLabel">
|
||||||
${state.translate('signInEmailEnter')}
|
${state.translate('signInEmailEnter')}
|
||||||
</div>
|
</div>
|
||||||
${state.translate('signInContinueMessage')}
|
${state.translate('signInContinueMessage')}
|
||||||
|
|
||||||
<form
|
<form
|
||||||
onsubmit=${submitEmail}
|
onsubmit=${submitEmail}
|
||||||
data-no-csrf>
|
data-no-csrf>
|
||||||
|
@ -43,24 +36,20 @@ module.exports = function(state, emit) {
|
||||||
type="text"
|
type="text"
|
||||||
class="signIn__emailInput"
|
class="signIn__emailInput"
|
||||||
placeholder=${state.translate('emailEntryPlaceholder')}/>
|
placeholder=${state.translate('emailEntryPlaceholder')}/>
|
||||||
|
|
||||||
<input
|
<input
|
||||||
class='noDisplay'
|
class='noDisplay'
|
||||||
id="emailSubmit"
|
id="emailSubmit"
|
||||||
type="submit"/>
|
type="submit"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<label class="btn" for="emailSubmit">
|
<label class="btn" for="emailSubmit">
|
||||||
${state.translate('signInContinueButton')}
|
${state.translate('signInContinueButton')}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
function submitEmail(event) {
|
function submitEmail(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
//TODO: hook up fxA onboarding
|
emit('login');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
const html = require('choo/html');
|
const html = require('choo/html');
|
||||||
|
|
||||||
module.exports = function(state) {
|
module.exports = function(state) {
|
||||||
|
if (state.user.loggedIn) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return html`
|
return html`
|
||||||
<div class="signupPromo">
|
<div class="signupPromo">
|
||||||
<div class="signupPromo__title">${state.translate('signInPromoText')}</div>
|
<div class="signupPromo__title">${state.translate('signInPromoText')}</div>
|
||||||
|
|
Loading…
Reference in a new issue