Improve debugging (#9)

* Improve debugging
This commit is contained in:
Karl Anders
2018-05-31 19:51:48 +02:00
committed by Rick van Lieshout
parent 8bf481fe59
commit 456d5b4fa0
2 changed files with 29 additions and 19 deletions

View File

@@ -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 });
}
}