2018-10-25 04:07:10 +02:00
|
|
|
const html = require('choo/html');
|
2019-01-29 22:08:54 +01:00
|
|
|
const modal = require('./modal');
|
2018-10-25 04:07:10 +02:00
|
|
|
|
2019-01-29 22:08:54 +01:00
|
|
|
module.exports = function(state, emit) {
|
2018-10-25 04:07:10 +02:00
|
|
|
let strings = {};
|
|
|
|
let why = '';
|
|
|
|
let url = '';
|
|
|
|
|
|
|
|
if (state.params.reason !== 'outdated') {
|
|
|
|
strings = unsupportedStrings(state);
|
|
|
|
why = html`
|
|
|
|
<a
|
2018-11-16 21:39:36 +01:00
|
|
|
class="text-blue"
|
|
|
|
href="https://github.com/mozilla/send/blob/master/docs/faq.md#why-is-my-browser-not-supported"
|
|
|
|
>
|
|
|
|
${state.translate('notSupportedLink')}
|
|
|
|
</a>
|
|
|
|
`;
|
2018-10-25 04:07:10 +02:00
|
|
|
url =
|
|
|
|
'https://www.mozilla.org/firefox/new/?utm_campaign=send-acquisition&utm_medium=referral&utm_source=send.firefox.com';
|
|
|
|
} else {
|
|
|
|
strings = outdatedStrings(state);
|
|
|
|
url = 'https://support.mozilla.org/kb/update-firefox-latest-version';
|
|
|
|
}
|
|
|
|
|
|
|
|
return html`
|
2019-02-22 22:31:54 +01:00
|
|
|
<main class="main">
|
2019-01-29 22:08:54 +01:00
|
|
|
${state.modal && modal(state, emit)}
|
2018-11-16 21:39:36 +01:00
|
|
|
<div
|
2019-02-22 22:16:24 +01:00
|
|
|
class="flex flex-col items-center justify-center text-center bg-white m-6 px-6 py-8 border border-grey-light md:border-none md:px-12 md:py-16 shadow w-full md:h-full"
|
2018-11-16 21:39:36 +01:00
|
|
|
>
|
2019-02-22 22:16:24 +01:00
|
|
|
<h1 class="">${strings.header}</h1>
|
|
|
|
<p class=" mt-4 mb-8 max-w-md leading-normal">${strings.description}</p>
|
2018-11-16 21:39:36 +01:00
|
|
|
${why}
|
2019-02-22 22:59:57 +01:00
|
|
|
<a href="${url}" class="btn rounded-lg mt-8 px-8">
|
2019-02-22 22:16:24 +01:00
|
|
|
${strings.button}
|
2018-11-16 21:39:36 +01:00
|
|
|
</a>
|
2018-10-25 04:07:10 +02:00
|
|
|
</div>
|
2018-11-16 21:39:36 +01:00
|
|
|
</main>
|
|
|
|
`;
|
2018-10-25 04:07:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
function outdatedStrings(state) {
|
|
|
|
return {
|
|
|
|
header: state.translate('notSupportedHeader'),
|
|
|
|
description: state.translate('notSupportedOutdatedDetail'),
|
|
|
|
button: state.translate('updateFirefox')
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
function unsupportedStrings(state) {
|
|
|
|
return {
|
|
|
|
header: state.translate('notSupportedHeader'),
|
2019-02-22 16:42:08 +01:00
|
|
|
description: state.translate('notSupportedDetailUpdate'),
|
2019-02-22 22:16:24 +01:00
|
|
|
button: state.translate('downloadFirefox')
|
2018-10-25 04:07:10 +02:00
|
|
|
};
|
|
|
|
}
|