From 8a7f291bceda0fd10b8aeaac2f75e7c0279867f7 Mon Sep 17 00:00:00 2001 From: Valik Date: Sun, 28 Jan 2024 12:52:18 +0100 Subject: [PATCH] =?UTF-8?q?refactor:=20update=20checks=20for=20improved=20?= =?UTF-8?q?readability=20and=20UX=20=F0=9F=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/App.jsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/App.jsx b/src/components/App.jsx index cfbf2c8..59d784d 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -24,7 +24,7 @@ class App extends Component { currentPage: 1, isLoading: false, error: null, - totalHits: 0, + totalHits: null, }; } @@ -91,24 +91,23 @@ class App extends Component { {isLoading && } {error && } - {images.length > 0 && !error ? ( + {images.length > 0 && !error && ( <> - - {totalHits > images.length && ( )} - ) : images.length === 0 && searchQuery && !error ? ( + )} + {!error && searchQuery && totalHits === 0 && ( - ) : ( - !error && )} + + {!searchQuery && } );