From 5f805e7773bc120583896277bffe1a99e1a785ce Mon Sep 17 00:00:00 2001 From: Brogan Clements Date: Fri, 8 Apr 2022 00:59:54 -0400 Subject: [PATCH] Change the loading screen to only ever affect the right column --- src/App.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/App.js b/src/App.js index fa480c6..7f500b8 100644 --- a/src/App.js +++ b/src/App.js @@ -82,7 +82,7 @@ function App() { swapMode(cookies.lightMode ? themes.lightMode : themes.darkMode); async function fetchData() { try { - setLoading(true); + // setLoading(true); let result = await axios.get( "https://raw.githubusercontent.com/FreeEbookFoundationBot/free-programming-books-json/main/fpb.json" ); @@ -203,10 +203,10 @@ function App() { } }, [searchParams, dataArray]); - if (loading) { - // if still fetching resource - return

Loading...

; - } + // if (loading) { + // // if still fetching resource + // return

Loading...

; + // } if (error) { return

Error: {error}

; } @@ -274,7 +274,9 @@ function App() {
- {resultsList ? ( + {loading ? ( +

Loading

+ ) : resultsList ? (

Search Results