import PropTypes from 'prop-types'; import React from 'react'; import ReactModal from 'react-modal'; import Box from '../box/box.jsx'; import {defineMessages, injectIntl, intlShape, FormattedMessage} from 'react-intl'; import {isRendererSupported, isNewFunctionSupported} from '../../lib/tw-environment-support-prober.js'; import styles from './browser-modal.css'; import unhappyBrowser from './unsupported-browser.svg'; const messages = defineMessages({ label: { id: 'gui.unsupportedBrowser.label', defaultMessage: 'Browser is not supported', description: '' } }); const noop = () => {}; const BrowserModal = ({intl, ...props}) => { const label = messages.label; return (

{/* eslint-disable max-len */} {isNewFunctionSupported() ? null : ( // This message should only be seen by website operators, so we don't need to translate it

{'Unable to compile JavaScript with new Function(). This is most likely caused by an overly-strict Content-Security-Policy. The CSP must include \'unsafe-eval\'.'}

)} {!isRendererSupported() && (

) }} />

) }} />

)}
); }; BrowserModal.propTypes = { intl: intlShape.isRequired, isRtl: PropTypes.bool }; const WrappedBrowserModal = injectIntl(BrowserModal); WrappedBrowserModal.setAppElement = ReactModal.setAppElement; export default WrappedBrowserModal;