diff options
| author | real-zephex <[email protected]> | 2024-05-13 21:24:07 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-05-13 21:24:07 +0530 |
| commit | bf9183d77462a709ec645c20bda12df97a81d26e (patch) | |
| tree | 85f21c522d46f1f13e783275d7a77f0d6eecaaa1 /src/app/anime/components | |
| parent | Update README.md (diff) | |
| parent | added loading.jsx file and it's css subpart (diff) | |
| download | dramalama-bf9183d77462a709ec645c20bda12df97a81d26e.tar.xz dramalama-bf9183d77462a709ec645c20bda12df97a81d26e.zip | |
Merge pull request #27 from real-zephex/improvement-2
added loading.jsx file and it's css subpart
Diffstat (limited to 'src/app/anime/components')
| -rw-r--r-- | src/app/anime/components/search.jsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/app/anime/components/search.jsx b/src/app/anime/components/search.jsx index b8b4b53..66c491a 100644 --- a/src/app/anime/components/search.jsx +++ b/src/app/anime/components/search.jsx @@ -10,9 +10,13 @@ import SearchResults from "./search_results"; const SearcBar = () => { const [title, setTitle] = useState(""); const [searchResults, setSearchResults] = useState(null); + const [loading, setLoading] = useState(false); const handleSearchInput = async (title) => { + setSearchResults(null); + setLoading(true); setSearchResults(await SearchResults(title)); + setLoading(false); }; return ( @@ -47,6 +51,11 @@ const SearcBar = () => { </button> </Link> </section> + {loading && ( + <p className={styles.SearchLoading}> + Please wait while we crunch up all the data..... + </p> + )} {searchResults} </main> ); |