0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-16 10:22:42 +00:00

Lint clean up

This commit is contained in:
G.Ambatte
2024-02-13 09:06:33 +13:00
parent 71c52b4587
commit 3bb44d8a17
2 changed files with 197 additions and 193 deletions

View File

@@ -61,7 +61,7 @@ const ArchivePage = createClass({
}
} catch (error) {
console.log("LoadPage error: " + error);
console.log(`LoadPage error: ${error}`);
}
}
},
@@ -80,33 +80,37 @@ const ArchivePage = createClass({
renderFoundBrews() {
const { title, brewCollection, page, totalPages, error } = this.state;
if (title === '') {return (<div className="foundBrews noBrews"><h3>Whenever you want, just start typing...</h3></div>);}
if(title === '') {return (<div className='foundBrews noBrews'><h3>Whenever you want, just start typing...</h3></div>);}
if (error !== null) { return (
<div className="foundBrews noBrews">
if(error !== null) {
return (
<div className='foundBrews noBrews'>
<div><h3>I'm sorry, your request didn't work</h3>
<br /><p>Your search is not specific enough. Too many brews meet this criteria for us to display them.</p>
</div></div>
);}
);
}
if (!brewCollection || brewCollection.length === 0) { return (
<div className="foundBrews noBrews">
if(!brewCollection || brewCollection.length === 0) {
return (
<div className='foundBrews noBrews'>
<h3>We haven't found brews meeting your request.</h3>
</div>
);}
);
}
return (
<div className="foundBrews">
<span className="brewCount">{`Brews Found: ${brewCollection.length}`}</span>
<div className='foundBrews'>
<span className='brewCount'>{`Brews Found: ${brewCollection.length}`}</span>
{brewCollection.map((brew, index)=>(
<BrewItem brew={brew} key={index} reportError={this.props.reportError} />
))}
<div className="paginationControls">
<div className='paginationControls'>
{page > 1 && (
<button onClick={()=>this.loadPage(page - 1)}>Previous Page</button>
)}
<span className="currentPage">Page {page}</span>
<span className='currentPage'>Page {page}</span>
{page < totalPages && (
<button onClick={()=>this.loadPage(page + 1)}>Next Page</button>
)}