File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,13 @@ import { setPreviousPath } from '../IDE/actions/ide';
77import { setLanguage } from '../IDE/actions/preferences' ;
88import CookieConsent from '../User/components/CookieConsent' ;
99
10+ function hideCookieConsent ( pathname ) {
11+ if ( pathname . includes ( '/full/' ) || pathname . includes ( '/embed/' ) ) {
12+ return true ;
13+ }
14+ return false ;
15+ }
16+
1017class App extends React . Component {
1118 constructor ( props , context ) {
1219 super ( props , context ) ;
@@ -40,9 +47,10 @@ class App extends React.Component {
4047 }
4148
4249 render ( ) {
50+ const hide = hideCookieConsent ( this . props . location . pathname ) ;
4351 return (
4452 < div className = "app" >
45- < CookieConsent />
53+ < CookieConsent hide = { hide } />
4654 { this . state . isMounted &&
4755 ! window . devToolsExtension &&
4856 getConfig ( 'NODE_ENV' ) === 'development' && < DevTools /> }
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import ReactGA from 'react-ga';
66import { Transition } from 'react-transition-group' ;
77import { Link } from 'react-router' ;
88import { Trans , useTranslation } from 'react-i18next' ;
9+ import { PropTypes } from 'prop-types' ;
910import getConfig from '../../../utils/getConfig' ;
1011import { setUserCookieConsent } from '../actions' ;
1112import { remSize , prop , device } from '../../../theme' ;
@@ -72,7 +73,7 @@ const CookieConsentButtons = styled.div`
7273 }
7374` ;
7475
75- function CookieConsent ( ) {
76+ function CookieConsent ( { hide } ) {
7677 const user = useSelector ( ( state ) => state . user ) ;
7778 const [ cookieConsent , setBrowserCookieConsent ] = useState ( 'none' ) ;
7879 const [ inProp , setInProp ] = useState ( false ) ;
@@ -154,6 +155,8 @@ function CookieConsent() {
154155 }
155156 } , [ cookieConsent ] ) ;
156157
158+ if ( hide ) return null ;
159+
157160 return (
158161 < Transition in = { inProp } timeout = { 500 } >
159162 { ( state ) => (
@@ -186,4 +189,12 @@ function CookieConsent() {
186189 ) ;
187190}
188191
192+ CookieConsent . propTypes = {
193+ hide : PropTypes . bool
194+ } ;
195+
196+ CookieConsent . defaultProps = {
197+ hide : false
198+ } ;
199+
189200export default CookieConsent ;
You can’t perform that action at this time.
0 commit comments