2018-02-13 20:32:59 +01:00
|
|
|
const html = require('choo/html');
|
|
|
|
const assets = require('../../../common/assets');
|
2018-07-31 20:09:18 +02:00
|
|
|
const title = require('../../templates/title');
|
2018-02-13 20:32:59 +01:00
|
|
|
|
|
|
|
module.exports = function(state) {
|
|
|
|
let strings = {};
|
|
|
|
let why = '';
|
|
|
|
let url = '';
|
|
|
|
let buttonAction = '';
|
2018-07-31 20:09:18 +02:00
|
|
|
|
2018-02-13 20:32:59 +01:00
|
|
|
if (state.params.reason !== 'outdated') {
|
|
|
|
strings = unsupportedStrings(state);
|
|
|
|
why = html`
|
|
|
|
<div class="description">
|
|
|
|
<a href="https://github.com/mozilla/send/blob/master/docs/faq.md#why-is-my-browser-not-supported">
|
|
|
|
${state.translate('notSupportedLink')}
|
|
|
|
</a>
|
|
|
|
</div>`;
|
|
|
|
url =
|
|
|
|
'https://www.mozilla.org/firefox/new/?utm_campaign=send-acquisition&utm_medium=referral&utm_source=send.firefox.com';
|
|
|
|
buttonAction = html`
|
|
|
|
<div class="firefoxDownload__action">
|
|
|
|
Firefox<br><span class="firefoxDownload__text">${strings.button}</span>
|
|
|
|
</div>`;
|
|
|
|
} else {
|
|
|
|
strings = outdatedStrings(state);
|
|
|
|
url = 'https://support.mozilla.org/kb/update-firefox-latest-version';
|
|
|
|
buttonAction = html`
|
|
|
|
<div class="firefoxDownload__action">
|
|
|
|
${strings.button}
|
|
|
|
</div>`;
|
|
|
|
}
|
2018-07-31 20:09:18 +02:00
|
|
|
|
2018-02-16 21:56:53 +01:00
|
|
|
return html`
|
2018-07-31 20:09:18 +02:00
|
|
|
<div class="page unsupportedPage">
|
|
|
|
${title(state)}
|
|
|
|
<div class="error unsupportedPage__error">${strings.header}</div>
|
|
|
|
<div class="description flexible">
|
2018-02-13 20:32:59 +01:00
|
|
|
${strings.description}
|
2018-07-31 20:09:18 +02:00
|
|
|
${why}
|
2018-02-13 20:32:59 +01:00
|
|
|
</div>
|
2018-07-31 20:09:18 +02:00
|
|
|
|
|
|
|
<div class="flexible firefoxDownload">
|
|
|
|
<a href="${url}" class="firefoxDownload__button">
|
|
|
|
<img
|
|
|
|
src="${assets.get('firefox_logo-only.svg')}"
|
|
|
|
class="firefoxDownload__logo"
|
|
|
|
alt="Firefox"/>
|
|
|
|
${buttonAction}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
2018-02-13 20:32:59 +01:00
|
|
|
<div class="unsupportedPage__info">
|
|
|
|
${strings.explainer}
|
|
|
|
</div>
|
|
|
|
</div>`;
|
|
|
|
};
|
2018-02-16 21:56:53 +01:00
|
|
|
|
|
|
|
function outdatedStrings(state) {
|
|
|
|
return {
|
2018-07-31 20:09:18 +02:00
|
|
|
header: state.translate('notSupportedHeader'),
|
2018-02-16 21:56:53 +01:00
|
|
|
description: state.translate('notSupportedOutdatedDetail'),
|
|
|
|
button: state.translate('updateFirefox'),
|
|
|
|
explainer: state.translate('uploadPageExplainer')
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
function unsupportedStrings(state) {
|
|
|
|
return {
|
2018-07-31 20:09:18 +02:00
|
|
|
header: state.translate('notSupportedHeader'),
|
2018-02-16 21:56:53 +01:00
|
|
|
description: state.translate('notSupportedDetail'),
|
|
|
|
button: state.translate('downloadFirefoxButtonSub'),
|
|
|
|
explainer: state.translate('uploadPageExplainer')
|
|
|
|
};
|
|
|
|
}
|