forked from naturalcrit/homebrewery
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into addLockNotification-naturalcrit#3326
- Loading branch information
Showing
26 changed files
with
3,304 additions
and
599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,25 @@ | ||
require('./errorPage.less'); | ||
const React = require('react'); | ||
const createClass = require('create-react-class'); | ||
const _ = require('lodash'); | ||
const cx = require('classnames'); | ||
|
||
const UIPage = require('../basePages/uiPage/uiPage.jsx'); | ||
|
||
const Markdown = require('../../../../shared/naturalcrit/markdown.js'); | ||
|
||
const React = require('react'); | ||
const UIPage = require('../basePages/uiPage/uiPage.jsx'); | ||
const Markdown = require('../../../../shared/naturalcrit/markdown.js'); | ||
const ErrorIndex = require('./errors/errorIndex.js'); | ||
|
||
const ErrorPage = createClass({ | ||
displayName : 'ErrorPage', | ||
|
||
getDefaultProps : function() { | ||
return { | ||
ver : '0.0.0', | ||
errorId : '', | ||
text : '# Oops \n We could not find a brew with that id. **Sorry!**', | ||
error : {} | ||
}; | ||
}, | ||
|
||
render : function(){ | ||
const errorText = ErrorIndex(this.props)[this.props.brew.HBErrorCode.toString()] || ''; | ||
const ErrorPage = ({ brew })=>{ | ||
// Retrieving the error text based on the brew's error code from ErrorIndex | ||
const errorText = ErrorIndex({ brew })[brew.HBErrorCode.toString()] || ''; | ||
|
||
return <UIPage brew={{ title: 'Crit Fail!' }}> | ||
return ( | ||
<UIPage brew={{ title: 'Crit Fail!' }}> | ||
<div className='dataGroup'> | ||
<div className='errorTitle'> | ||
<h1>{`Error ${this.props.brew.status || '000'}`}</h1> | ||
<h4>{this.props.brew.text || 'No error text'}</h4> | ||
<h1>{`Error ${brew?.status || '000'}`}</h1> | ||
<h4>{brew?.text || 'No error text'}</h4> | ||
</div> | ||
<hr /> | ||
<div dangerouslySetInnerHTML={{ __html: Markdown.render(errorText) }} /> | ||
</div> | ||
</UIPage>; | ||
} | ||
}); | ||
</UIPage> | ||
); | ||
}; | ||
|
||
module.exports = ErrorPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.