diff --git a/client/homebrew/pages/errorPage/errorPage.jsx b/client/homebrew/pages/errorPage/errorPage.jsx index 33da05017..387a99b02 100644 --- a/client/homebrew/pages/errorPage/errorPage.jsx +++ b/client/homebrew/pages/errorPage/errorPage.jsx @@ -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', +const ErrorPage = ({ brew })=>{ + // Retrieving the error text based on the brew's error code from ErrorIndex + const errorText = ErrorIndex({ brew })[brew.HBErrorCode.toString()] || ''; - 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()] || ''; - - return + return ( +
-

{`Error ${this.props.brew.status || '000'}`}

-

{this.props.brew.text || 'No error text'}

+

{`Error ${brew?.status || '000'}`}

+

{brew?.text || 'No error text'}


- ; - } -}); + + ); +}; module.exports = ErrorPage;