0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 15:42:38 +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 (
<div className="foundBrews">
<span className="totalBrews">
Brews found:
{() => {
if (title == '') {
return '0';
}
if (this.state.totalBrews) {
return this.state.totalBrews;
}
return '<span className="searchAnim"></span>';
}}
Brews found:
{title === '' ? '0' : this.state.totalBrews ? this.state.totalBrews : <span className="searchAnim"></span>}
</span>
{brewCollection.map((brew, index) => (
<BrewItem
@@ -424,6 +416,7 @@ const ArchivePage = createClass({
{this.renderPaginationControls()}
</div>
);
},
render: function () {