send/app/ui/unsupported.js

58 lines
1.7 KiB
JavaScript
Raw Normal View History

2018-10-25 02:07:10 +00:00
const html = require('choo/html');
2019-01-29 21:08:54 +00:00
const modal = require('./modal');
2018-10-25 02:07:10 +00:00
2019-01-29 21:08:54 +00:00
module.exports = function(state, emit) {
2018-10-25 02:07:10 +00:00
let strings = {};
let why = '';
let url = '';
if (state.params.reason !== 'outdated') {
strings = unsupportedStrings(state);
why = html`
<a
2018-11-16 20:39:36 +00: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 02:07:10 +00: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 21:31:54 +00:00
<main class="main">
2019-01-29 21:08:54 +00:00
${state.modal && modal(state, emit)}
2019-02-28 23:53:13 +00:00
<section
2019-02-22 21:16:24 +00: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 20:39:36 +00:00
>
2019-02-22 21:16:24 +00:00
<h1 class="">${strings.header}</h1>
2019-02-28 23:53:13 +00:00
<p class="mt-4 mb-8 max-w-md leading-normal">${strings.description}</p>
2018-11-16 20:39:36 +00:00
${why}
2019-02-22 21:59:57 +00:00
<a href="${url}" class="btn rounded-lg mt-8 px-8">
2019-02-22 21:16:24 +00:00
${strings.button}
2018-11-16 20:39:36 +00:00
</a>
2019-02-28 23:53:13 +00:00
</section>
2018-11-16 20:39:36 +00:00
</main>
`;
2018-10-25 02:07:10 +00: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'),
description: state.translate('notSupportedDescription'),
2019-02-22 21:16:24 +00:00
button: state.translate('downloadFirefox')
2018-10-25 02:07:10 +00:00
};
}