From edfa691a381746a31dc2119c1f580dd6b564fe8e Mon Sep 17 00:00:00 2001
From: Miroslav Ljubicic <127101426+mrkyns@users.noreply.github.com>
Date: Fri, 21 Apr 2023 12:25:02 +0200
Subject: [PATCH] add component and solution for search without result
---
src/App.css | 31 +++++++++++++++++++++++++++++++
src/App.jsx | 1 +
src/components/Body.jsx | 10 +++++++++-
src/components/NoResult.jsx | 15 +++++++++++++++
src/components/Pagination.jsx | 2 +-
5 files changed, 57 insertions(+), 2 deletions(-)
create mode 100644 src/components/NoResult.jsx
diff --git a/src/App.css b/src/App.css
index ab24088..891b890 100644
--- a/src/App.css
+++ b/src/App.css
@@ -229,6 +229,37 @@ nav ul li a:hover {
border-left: 2px solid var(--text_light);
color: var(--text_light);
}
+
+/* ==============================
+ No Search Result
+============================== */
+
+.NoResult {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 40px;
+ margin: 40px 0;
+}
+
+.NoResult svg {
+ fill: var(--article_bg);
+ width: 150px;
+}
+
+.NoResult h2 {
+ color: var(--accent);
+ font-size: 45px;
+}
+
+.NoResult p {
+ color: var(--text);
+}
+
+.NoResult p span {
+ color: var(--accent);
+}
+
/* ==============================
Article
============================== */
diff --git a/src/App.jsx b/src/App.jsx
index 1028732..0f2086f 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -42,6 +42,7 @@ function App() {
setHitsPerPage={setHitsPerPage}
setPageNum={setPageNum}
loading={loading}
+ query={query}
/>
+ Search for {query.query}, didn't found any articls! +
+