Closed Mogoww closed 1 year ago
@mitchiemt11 Please review this PR when you have a chance π
@Mogoww PR is correct. I'm merging it now. Would you mind if I assign this to you --->> https://github.com/mitchiemt11/trailers-trove/issues/24? It's kinda related to this one.
Pull Request Title: β¨ Handle search filter when no results are found β¨
Description:
This Pull Request proposes a code modification to handle empty search results in a more user-friendly way. When the search yields no results, instead of displaying an empty list, the text "Oops!, No results found" is now displayed in the center of the screen to inform the user of the absence of results. π
Details of Changes:
I added a new CSS class called "no-results" to style the text displayed when the search yields no results. The CSS class centers the text, sets the font size to 2rem, and adds a top margin of 50px for better presentation. π¨
I introduced a new state variable
noResults
that is updated based on the search result. If the search yields no results,noResults
is set totrue
, otherwise, it's set tofalse
. πI modified the component structure to conditionally display the filtered movie list or the text "Oops!, No results found" based on the value of
noResults
. π§Tests: