0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-14 04:12:43 +00:00

"Simplified conditional statement for displaying total brews count"

This commit is contained in:
Víctor Losada Hernández
2024-05-22 08:21:00 +02:00
parent d56ea62b5e
commit 215888baf4

View File

@@ -403,16 +403,8 @@ const ArchivePage = createClass({
return ( return (
<div className="foundBrews"> <div className="foundBrews">
<span className="totalBrews"> <span className="totalBrews">
Brews found: Brews found:
{() => { {title === '' ? '0' : this.state.totalBrews ? this.state.totalBrews : <span className="searchAnim"></span>}
if (title == '') {
return '0';
}
if (this.state.totalBrews) {
return this.state.totalBrews;
}
return '<span className="searchAnim"></span>';
}}
</span> </span>
{brewCollection.map((brew, index) => ( {brewCollection.map((brew, index) => (
<BrewItem <BrewItem
@@ -424,6 +416,7 @@ const ArchivePage = createClass({
{this.renderPaginationControls()} {this.renderPaginationControls()}
</div> </div>
); );
}, },
render: function () { render: function () {