Update feed.js
This commit is contained in:
@@ -10,12 +10,9 @@ export default ({ data, limit }) => {
|
|||||||
.slice(0, limit || data.allBooksJson.edges.length)
|
.slice(0, limit || data.allBooksJson.edges.length)
|
||||||
.sort(compareFunctions[sortBy]);
|
.sort(compareFunctions[sortBy]);
|
||||||
|
|
||||||
const handleSortByItemClick = (field) => {
|
|
||||||
setSortBy(field);
|
|
||||||
};
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SortByDropdown sortBy={sortBy} onSortByItemClick={handleSortByItemClick} />
|
<SortByDropdown sortBy={sortBy} onSortByItemClick={setSortBy} />
|
||||||
{getSortedBooks().map((x, index) => {
|
{getSortedBooks().map((x, index) => {
|
||||||
const book = x.node;
|
const book = x.node;
|
||||||
if (!limit || index < limit) {
|
if (!limit || index < limit) {
|
||||||
|
|||||||
Reference in New Issue
Block a user