NguyenPhuLoc666666 / df-frontend-2023

https://df-frontend-2023-murex.vercel.app
0 stars 0 forks source link

Submission for assignment-2 #2

Open NguyenPhuLoc666666 opened 1 year ago

NguyenPhuLoc666666 commented 1 year ago

link: https://df-frontend-2023-9182-nguyenphuloc666666.vercel.app/

trankhacvy commented 1 year ago

Hello @NguyenPhuLoc666666 , well done!

Requirements

Final result: ✅ passed

Feedback

We also have some comments for your work:

  1. The search function isn't working; the app crashes when I try to search.

  2. The No column should display the current index instead of always showing 1 - 5 on every page.

  3. I created a book belonging to the Software Development topic, but it's displaying in the table under the Database topic.

  4. Since we're using React, whenever you update the books state, React automatically re-renders the page and updates your table. So, you don't need to call the renderBooks(books) function.

  5. You have handleOpenDialog and handleCloseDialog functions to manage opening and closing modals. Why not include the logic for opening and closing the CreateBookModal inside these functions instead of creating separate ones?

  6. Your Button component seems a bit unusual. There's no need to pass the data property and then use it in the onClick handler. Instead, you can use it like this:

<button onClick={() => handleOpenDialogCreate('dialogCreate')}>Add book</button>
  1. Instead of using the DOM to get values from input, you can declare state variables for these inputs. After all, we're using React, right?

https://github.com/NguyenPhuLoc666666/df-frontend-2023/blob/3dce96f0089cb096a7ad1cc75ebabf895255d216/assignment-2/src/components/DialogCreate.js#L10-L14