From 373bc58bcc18ab04f570f82108a04e1a719bd4ab Mon Sep 17 00:00:00 2001 From: haraldnilsen Date: Wed, 6 Sep 2023 11:09:23 +0200 Subject: [PATCH] :children_crossing: better user experience before searching movie Co-authored-by: Sindre Kjelsrud --- src/App.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index a9f7e81..65aa179 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -21,7 +21,7 @@ function App() { useEffect(() => { fetch( - `http://www.omdbapi.com/?apikey=${API_MOVIE_KEY}&s=spider-man&page=${currentPage}` + `http://www.omdbapi.com/?apikey=${API_MOVIE_KEY}&s=${movieTitle}&page=${currentPage}` ) .then((response) => response.json()) .then((data) => { @@ -106,10 +106,12 @@ function App() { /> )} - {!loading && movies ? ( + {loading ? ( + Loading... + ) : movies ? ( ) : ( - Loading... + Find a list of movies by searching above ☝️ )}