1 import { useEffect } from 'react';
3 import { Href } from '@proton/atoms';
4 import type { CompatibilityItem } from '@proton/components/containers/compatibilityCheck/compatibilityCheckHelper';
5 import { getAppName } from '@proton/shared/lib/apps/helper';
6 import type { APP_NAMES } from '@proton/shared/lib/constants';
7 import { APPS } from '@proton/shared/lib/constants';
8 import { getBrowser } from '@proton/shared/lib/helpers/browser';
9 import { captureMessage } from '@proton/shared/lib/helpers/sentry';
10 import { getItem, setItem } from '@proton/shared/lib/helpers/storage';
11 import { getKnowledgeBaseUrl } from '@proton/shared/lib/helpers/url';
12 import unsupportedBrowserSettings from '@proton/styles/assets/img/errors/unsupported-browser.svg';
14 import useAppTitle from '../../hooks/useAppTitle';
18 incompatibilities: CompatibilityItem[];
21 const key = 'compatibility-check.notified';
23 // Note: This is not translated because locales are not loaded at this point
24 const CompatibilityCheckView = ({ appName = APPS.PROTONMAIL, incompatibilities }: Props) => {
25 const isVPN = appName === APPS.PROTONVPN_SETTINGS;
27 ? 'https://protonvpn.com/support/browsers-supported/'
28 : getKnowledgeBaseUrl('/recommended-browsers');
30 useAppTitle('Compatibility check');
33 const notified = getItem(key);
35 captureMessage('Compatibility check failed', {
37 extra: { reason: incompatibilities.map(({ name }) => name).join(',') },
43 const app = getAppName(appName);
44 const incompatibilitiesWithText = incompatibilities.filter((incompat) => !!incompat.text);
45 const browser = getBrowser();
48 <div className="h-full flex items-center overflow-auto">
49 <div className="m-auto text-center max-w-custom" style={{ '--max-w-custom': '30em' }}>
50 <div className="mb-8 text-center">
51 <img src={unsupportedBrowserSettings} alt="" />
53 <h1 className="text-bold text-4xl">Compatibility check</h1>
55 {app} requires a modern web browser with cutting edge support for{' '}
56 <Href className="primary-link" href="http://caniuse.com/#feat=cryptography">
60 <Href className="primary-link" href="http://caniuse.com/#feat=namevalue-storage">
65 <p>Your browser: {`${browser.name} - ${browser.version}`}</p>
66 {incompatibilitiesWithText.length > 0 && (
67 <ul className="text-left">
68 {incompatibilitiesWithText.map(({ name, text }) => {
77 <Href href={kbUrl} target="_self">
85 export default CompatibilityCheckView;