diff --git a/client/modules/App/App.jsx b/client/modules/App/App.jsx index 7e602f272e..1f41446a79 100644 --- a/client/modules/App/App.jsx +++ b/client/modules/App/App.jsx @@ -7,6 +7,13 @@ import { setPreviousPath } from '../IDE/actions/ide'; import { setLanguage } from '../IDE/actions/preferences'; import CookieConsent from '../User/components/CookieConsent'; +function hideCookieConsent(pathname) { + if (pathname.includes('/full/') || pathname.includes('/embed/')) { + return true; + } + return false; +} + class App extends React.Component { constructor(props, context) { super(props, context); @@ -40,9 +47,10 @@ class App extends React.Component { } render() { + const hide = hideCookieConsent(this.props.location.pathname); return (
- + {this.state.isMounted && !window.devToolsExtension && getConfig('NODE_ENV') === 'development' && } diff --git a/client/modules/User/components/CookieConsent.jsx b/client/modules/User/components/CookieConsent.jsx index cdacf45f02..7af4d482aa 100644 --- a/client/modules/User/components/CookieConsent.jsx +++ b/client/modules/User/components/CookieConsent.jsx @@ -6,6 +6,7 @@ import ReactGA from 'react-ga'; import { Transition } from 'react-transition-group'; import { Link } from 'react-router'; import { Trans, useTranslation } from 'react-i18next'; +import { PropTypes } from 'prop-types'; import getConfig from '../../../utils/getConfig'; import { setUserCookieConsent } from '../actions'; import { remSize, prop, device } from '../../../theme'; @@ -72,7 +73,7 @@ const CookieConsentButtons = styled.div` } `; -function CookieConsent() { +function CookieConsent({ hide }) { const user = useSelector((state) => state.user); const [cookieConsent, setBrowserCookieConsent] = useState('none'); const [inProp, setInProp] = useState(false); @@ -154,6 +155,8 @@ function CookieConsent() { } }, [cookieConsent]); + if (hide) return null; + return ( {(state) => ( @@ -186,4 +189,12 @@ function CookieConsent() { ); } +CookieConsent.propTypes = { + hide: PropTypes.bool +}; + +CookieConsent.defaultProps = { + hide: false +}; + export default CookieConsent;