Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
Signed-off-by: T. Lanette <[email protected]>
  • Loading branch information
tlanettepollard committed May 15, 2022
1 parent ba1c01c commit d84ea5d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/SearchBooksPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { Link } from 'react-router-dom';
import * as BooksAPI from '../BooksAPI';


const SearchBooksPage = ({ books, newBookShelf }) => {
const SearchBooksPage = ({ books, newBookShelf, shelf }) => {
const [query, setQuery] = useState('');
const [matchedBooks, setMatchedBooks] = useState([]);


const updateQuery = (query) => {
setQuery(query);
Expand Down Expand Up @@ -52,17 +52,17 @@ const SearchBooksPage = ({ books, newBookShelf }) => {
<div className="search-books-results">
<ol className="books-grid">
{query && matchedBooks.map((matchedBooks) => {
let shelf = 'none';
//let shelf = 'none';
books.map((book) => book.id === matchedBooks.id ? (shelf = book.shelf) : '');
return (
return (
<li key={matchedBooks.id}>
<Book
book={matchedBooks}
shelf={shelf}
newBookShelf={newBookShelf}
handleBooksSearch={handleBooksSearch}
/>
</li>
</li>
);
})}
</ol>
Expand Down

0 comments on commit d84ea5d

Please sign in to comment.