Update feed.js

This commit is contained in:
Gal Elmalah
2020-10-11 12:04:23 +03:00
committed by Vishnu Ks
parent 68e0dbe1cb
commit 193f06bb21

View File

@@ -10,12 +10,9 @@ export default ({ data, limit }) => {
.slice(0, limit || data.allBooksJson.edges.length)
.sort(compareFunctions[sortBy]);
const handleSortByItemClick = (field) => {
setSortBy(field);
};
return (
<>
<SortByDropdown sortBy={sortBy} onSortByItemClick={handleSortByItemClick} />
<SortByDropdown sortBy={sortBy} onSortByItemClick={setSortBy} />
{getSortedBooks().map((x, index) => {
const book = x.node;
if (!limit || index < limit) {