@@ -6,6 +6,7 @@ import ReactGA from 'react-ga';
6
6
import { Transition } from 'react-transition-group' ;
7
7
import { Link } from 'react-router' ;
8
8
import { Trans , useTranslation } from 'react-i18next' ;
9
+ import { PropTypes } from 'prop-types' ;
9
10
import getConfig from '../../../utils/getConfig' ;
10
11
import { setUserCookieConsent } from '../actions' ;
11
12
import { remSize , prop , device } from '../../../theme' ;
@@ -72,7 +73,7 @@ const CookieConsentButtons = styled.div`
72
73
}
73
74
` ;
74
75
75
- function CookieConsent ( ) {
76
+ function CookieConsent ( { hide } ) {
76
77
const user = useSelector ( ( state ) => state . user ) ;
77
78
const [ cookieConsent , setBrowserCookieConsent ] = useState ( 'none' ) ;
78
79
const [ inProp , setInProp ] = useState ( false ) ;
@@ -154,6 +155,8 @@ function CookieConsent() {
154
155
}
155
156
} , [ cookieConsent ] ) ;
156
157
158
+ if ( hide ) return null ;
159
+
157
160
return (
158
161
< Transition in = { inProp } timeout = { 500 } >
159
162
{ ( state ) => (
@@ -186,4 +189,12 @@ function CookieConsent() {
186
189
) ;
187
190
}
188
191
192
+ CookieConsent . propTypes = {
193
+ hide : PropTypes . bool
194
+ } ;
195
+
196
+ CookieConsent . defaultProps = {
197
+ hide : false
198
+ } ;
199
+
189
200
export default CookieConsent ;
0 commit comments