send/app/ui/unsupported.js

74 lines
2.2 KiB
JavaScript
Raw Normal View History

2018-10-25 02:07:10 +00:00
const html = require('choo/html');
const assets = require('../../common/assets');
module.exports = function(state) {
let strings = {};
let why = '';
let url = '';
let buttonAction = '';
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';
buttonAction = html`
2018-11-02 09:27:59 +00:00
<p class="ml-4 font-bold">
2018-11-16 20:39:36 +00:00
Firefox<br /><span class="font-light text-base">${strings.button}</span>
</p>
`;
2018-10-25 02:07:10 +00:00
} else {
strings = outdatedStrings(state);
url = 'https://support.mozilla.org/kb/update-firefox-latest-version';
buttonAction = html`
2018-11-16 20:39:36 +00:00
<p class="ml-4">${strings.button}</p>
`;
2018-10-25 02:07:10 +00:00
}
return html`
2018-10-30 18:37:33 +00:00
<main class="main container">
2018-11-16 20:39:36 +00:00
<div
class="flex flex-col items-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"
>
<h1 class="text-center text-2xl">${strings.header}</h1>
<p class="my-10 max-w-md leading-normal">${strings.description}</p>
${why}
<a
href="${url}"
class="border border-green-light rounded bg-green hover\:bg-green-dark focus\:bg-green-darker flex items-center justify-center text-2xl text-white mt-10 py-4 px-6"
>
<img
src="${assets.get('firefox_logo-only.svg')}"
class="w-10"
alt="Firefox"
/>
${buttonAction}
</a>
2018-10-25 02:07:10 +00:00
</div>
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('notSupportedDetail'),
button: state.translate('downloadFirefoxButtonSub')
};
}