require('./renderWarnings.less');
const React = require('react');
const createClass = require('create-react-class');
const _ = require('lodash');
import Dialog from '../dialog.jsx';
const RenderWarnings = createClass({
displayName : 'RenderWarnings',
getInitialState : function() {
return {
warnings : {}
};
},
componentDidMount : function() {
this.checkWarnings();
window.addEventListener('resize', this.checkWarnings);
},
componentWillUnmount : function() {
window.removeEventListener('resize', this.checkWarnings);
},
warnings : {
chrome : function(){
const isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
if(!isChrome){
return
Built for Chrome
Other browsers have not been tested for compatibility. If you
experience issues with your document not rendering or printing
properly, please try using the latest version of Chrome before
submitting a bug report.
;
}
},
},
checkWarnings : function(){
this.setState({
warnings : _.reduce(this.warnings, (r, fn, type)=>{
const element = fn();
if(element) r[type] = element;
return r;
}, {})
});
},
render : function(){
if(_.isEmpty(this.state.warnings)) return null;
const DISMISS_KEY = 'dismiss_render_warning';
const DISMISS_TEXT = ;
return ;
}
});
module.exports = RenderWarnings;