🚸 better user experience before searching movie
Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
parent
ca73d10408
commit
373bc58bcc
1 changed files with 5 additions and 3 deletions
|
@ -21,7 +21,7 @@ function App() {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetch(
|
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((response) => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
@ -106,10 +106,12 @@ function App() {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</q.div>
|
</q.div>
|
||||||
{!loading && movies ? (
|
{loading ? (
|
||||||
|
<q.h1>Loading...</q.h1>
|
||||||
|
) : movies ? (
|
||||||
<MovieTable {...{ handleModalOpen, sortHandler, movies }} />
|
<MovieTable {...{ handleModalOpen, sortHandler, movies }} />
|
||||||
) : (
|
) : (
|
||||||
<q.h1>Loading...</q.h1>
|
<q.h2>Find a list of movies by searching above ☝️ </q.h2>
|
||||||
)}
|
)}
|
||||||
</q.div>
|
</q.div>
|
||||||
</q.div>
|
</q.div>
|
||||||
|
|
Reference in a new issue