Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - search #1

Merged
merged 34 commits into from
Dec 30, 2020
Merged

Feature - search #1

merged 34 commits into from
Dec 30, 2020

Conversation

giovanizanetti
Copy link
Owner

Description

In this branch is created a search functionality:

  • Allow the user to type the desired book title or author.
  • Allow the user to instantly add books in one of their shelves.
  • Display a message if the book is not on the DB.

In there are some important modifications in order to facilitate the data flow between components:

  • Create a BookContext and Book provider to hold a global state.
  • Remove some of the props passed down to components.

The search feature looks like this:

Feature - Search

- handle routing inside the main component - receive data from single source of thuth comming from App.js
pass handleShelf down though the BooksContext as oppesed to pass it five layers down via props.
pass handleShelf down though the BooksContext as opposed to pass it five layers down via props. Therefore wirte cleaner code.
pass handleShelf down though the BooksContext as opposed to pass it five layers down via props. Therefore wirte cleaner code.
enable serach book by entering a query
function can be reused for book on mybooks and for book from search results.
handle book with no tumbnails and replace by a default placeholder
by removing the unnecessary dependency, every time book changes the component is updated and book shelves are updated instantly
create useDebounce hook to abstractthe logict for debouncing
create useDebounce hook to abstracthe logic, tehreferofe could be re-used in different components
@giovanizanetti giovanizanetti merged commit 69cbdc4 into main Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant