mirror of
https://github.com/Mastermindzh/react-cookie-consent.git
synced 2025-08-23 09:35:04 +02:00
17
src/index.js
17
src/index.js
@@ -19,9 +19,9 @@ class CookieConsent extends Component {
|
||||
background: "#353535",
|
||||
color: "white",
|
||||
display: "flex",
|
||||
flexWrap: "wrap"
|
||||
justifyContent: "space-between",
|
||||
left: "0",
|
||||
padding: "15px",
|
||||
position: "fixed",
|
||||
width: "100%",
|
||||
zIndex: "999"
|
||||
@@ -35,16 +35,23 @@ class CookieConsent extends Component {
|
||||
flex: "0 0 auto",
|
||||
marginLeft: "15px",
|
||||
padding: "5px 10px",
|
||||
marginRight: "25px"
|
||||
margin: "15px"
|
||||
},
|
||||
contentStyle: {}
|
||||
contentStyle: {
|
||||
flex: "1 0 300px",
|
||||
margin: "15px"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { cookieName } = this.props;
|
||||
const { cookieName, debug } = this.props;
|
||||
|
||||
if (Cookies.get(cookieName) != undefined) {
|
||||
// debug not desired and cookieName not undefined
|
||||
if (
|
||||
!(debug !== undefined && debug) &&
|
||||
Cookies.get(cookieName) !== undefined
|
||||
) {
|
||||
this.setState({ visible: false });
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user