drop.chapril.org-firefoxsend/app/ui/unsupported.js

58 lines
1.7 KiB
JavaScript
Raw Normal View History

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
2022-04-12 15:58:58 +02:00
class="text-primary"
href="https://github.com/timvisee/send/blob/master/docs/faq.md#why-is-my-browser-not-supported"
2018-11-16 21:39:36 +01:00
>
${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)}
2019-03-01 00:53:13 +01:00
<section
2022-08-09 11:00:43 +02:00
class="flex flex-col items-center justify-center text-center bg-white m-6 px-6 py-8 border-default border-grey-30 md:border-none md:px-12 md:py-16 shadow-default w-full md:h-full dark:bg-grey-90"
2018-11-16 21:39:36 +01:00
>
2019-06-14 20:30:43 +02:00
<h1 class="text-3xl font-bold">${strings.header}</h1>
2019-03-01 00:53:13 +01:00
<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>
2019-03-01 00:53:13 +01:00
</section>
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'),
description: state.translate('notSupportedDescription'),
2019-02-22 22:16:24 +01:00
button: state.translate('downloadFirefox')
2018-10-25 04:07:10 +02:00
};
}