reorged routes/index.js (broken)

This commit is contained in:
Danny Coates 2018-10-01 14:20:26 -07:00
parent 8964387331
commit 5b939d2c95
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
3 changed files with 30 additions and 30 deletions

View File

@ -1,6 +1,8 @@
const html = require('choo/html'); 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');
const signupPromo = require('../../templates/signupPromo');
const fileList = require('../../templates/fileList');
const setPasswordSection = require('../../templates/setPasswordSection'); const setPasswordSection = require('../../templates/setPasswordSection');
const uploadBox = require('../../templates/uploadedFileList'); const uploadBox = require('../../templates/uploadedFileList');
const expireInfo = require('../../templates/expireInfo'); const expireInfo = require('../../templates/expireInfo');
@ -30,9 +32,30 @@ module.exports = function(state, emit) {
} }
return html` return html`
<div class="${fade}"> <div class="${fade} welcome">
${title(state)} ${title(state)}
<div class="welcome__file-manager">
</div>
<div class="welcome__context">
<div class="welcome__signup-promo">
${signupPromo(state)}
</div>
<div class="welcome__file-list">
${fileList(state)}
</div>
<div class="welcome__context-footer">
<a
href="https://www.mozilla.org"
class="socialSection__link">
<img
class="footer__mozLogo"
src="${assets.get('mozilla-logo.svg')}"
alt="mozilla"/>
</a>
</div>
</div>
<label class="uploadArea" <label class="uploadArea"
ondragover=${dragover} ondragover=${dragover}

View File

@ -4,11 +4,7 @@ const nanotiming = require('nanotiming');
const download = require('./download'); const download = require('./download');
const footer = require('../templates/footer'); const footer = require('../templates/footer');
const fxPromo = require('../templates/fxPromo'); const fxPromo = require('../templates/fxPromo');
const signupPromo = require('../templates/signupPromo');
const fileList = require('../templates/fileList');
const profile = require('../templates/userAccount');
const modal = require('../templates/modal'); const modal = require('../templates/modal');
const assets = require('../../common/assets');
const header = require('../templates/header'); const header = require('../templates/header');
nanotiming.disabled = true; nanotiming.disabled = true;
@ -28,12 +24,12 @@ module.exports = function() {
} }
} }
function body(template) { function body(page) {
return function(state, emit) { return function(state, emit) {
const b = html`<body> const b = html`<body>
${modalDialog(state, emit)} ${modalDialog(state, emit)}
${banner(state, emit)} ${banner(state, emit)}
${header(state)} ${header(state, emit)}
<main class="main"> <main class="main">
<noscript> <noscript>
<div class="noscript"> <div class="noscript">
@ -46,28 +42,7 @@ module.exports = function() {
<p>${state.translate('enableJavascript')}</p> <p>${state.translate('enableJavascript')}</p>
</div> </div>
</noscript> </noscript>
<div class="main__file-manager"> ${page(state, emit)}
${profile(state, emit)}
${template(state, emit)}
</div>
<div class="main__context">
<div class="main__signup-promo">
${signupPromo(state)}
</div>
<div class="main__file-list">
${fileList(state)}
</div>
<div class="main__context-footer">
<a
href="https://www.mozilla.org"
class="socialSection__link">
<img
class="footer__mozLogo"
src="${assets.get('mozilla-logo.svg')}"
alt="mozilla"/>
</a>
</div>
</div>
</main> </main>
${footer(state)} ${footer(state)}
</body>`; </body>`;

View File

@ -1,14 +1,16 @@
const html = require('choo/html'); const html = require('choo/html');
const userAccount = require('../../templates/userAccount');
const version = require('../../../package.json').version; const version = require('../../../package.json').version;
const { browserName } = require('../../utils'); const { browserName } = require('../../utils');
module.exports = function(state) { module.exports = function(state, emit) {
const browser = browserName(); const browser = browserName();
const feedbackUrl = `https://qsurvey.mozilla.com/s3/txp-firefox-send?ver=${version}&browser=${browser}`; const feedbackUrl = `https://qsurvey.mozilla.com/s3/txp-firefox-send?ver=${version}&browser=${browser}`;
const header = html` const header = html`
<header class="header"> <header class="header">
<h1>Firefox Send</h1> <h1>Firefox Send</h1>
${userAccount(state, emit)}
<a href="${feedbackUrl}" <a href="${feedbackUrl}"
rel="noreferrer noopener" rel="noreferrer noopener"
class="feedback" class="feedback"