Skip to content

Commit

Permalink
fix books random generator
Browse files Browse the repository at this point in the history
  • Loading branch information
DidierRLopes committed Jan 7, 2024
1 parent 8089142 commit d098efc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/BooksToRead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const booksToRead = [
},
{
title: 'User Story Mapping: Discover the Whole Story, Build the Right Product',
author: 'Jeff Patton (Author)',
author: 'Jeff Patton',
image: 'https://m.media-amazon.com/images/I/51xjwiaguCL.jpg',
},
{
Expand Down
6 changes: 1 addition & 5 deletions src/components/General/BooksList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@ interface BooksListProps {
}

export default function BooksList({ books }: BooksListProps) {
const booksShuffled = books
.map((value) => ({ value, sort: Math.random() }))
.sort((a, b) => a.sort - b.sort)
.map(({ value }) => value);

return (
<div>
<div className="mx-auto mt-8 md:grid md:grid-cols-2">
{booksShuffled.map((book) => (
{books.map((book) => (
<div className='flex my-4 mx-2 border-[1px] p-2 gap-6 rounded border-[#0088CC]'>
<div className='w-[100px] flex justify-center items-center'>
<img
Expand Down

0 comments on commit d098efc

Please sign in to comment.