0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-29 11:12:39 +00:00
This commit is contained in:
Scott Tolksdorf
2018-04-08 22:23:03 -04:00
parent bf27250990
commit ed1b5252be
51 changed files with 2837 additions and 2852 deletions

View File

@@ -1,15 +1,15 @@
var React = require('react');
var _ = require('lodash');
var cx = require('classnames');
const React = require('react');
const _ = require('lodash');
const cx = require('classnames');
var ErrorBar = React.createClass({
getDefaultProps: function() {
const ErrorBar = React.createClass({
getDefaultProps : function() {
return {
errors : []
};
},
hasOpenError : false,
hasOpenError : false,
hasCloseError : false,
hasMatchError : false,
@@ -19,20 +19,20 @@ var ErrorBar = React.createClass({
this.hasMatchError = false;
var errors = _.map(this.props.errors, (err, idx) => {
const errors = _.map(this.props.errors, (err, idx)=>{
if(err.id == 'OPEN') this.hasOpenError = true;
if(err.id == 'CLOSE') this.hasCloseError = true;
if(err.id == 'MISMATCH') this.hasMatchError = true;
return <li key={idx}>
Line {err.line} : {err.text}, '{err.type}' tag
</li>
</li>;
});
return <ul>{errors}</ul>
return <ul>{errors}</ul>;
},
renderProtip : function(){
var msg = [];
const msg = [];
if(this.hasOpenError){
msg.push(<div>
An unmatched opening tag means there's an opened tag that isn't closed, you need to close a tag, like this {'</div>'}. Make sure to match types!
@@ -53,7 +53,7 @@ var ErrorBar = React.createClass({
return <div className='protips'>
<h4>Protips!</h4>
{msg}
</div>
</div>;
},
render : function(){
@@ -66,7 +66,7 @@ var ErrorBar = React.createClass({
{this.renderErrors()}
<hr />
{this.renderProtip()}
</div>
</div>;
}
});