Open kbuiblue opened 11 months ago
Nice work 👍
Final result: ✅ passed 70% of requirements
We can use some basic validation for the add book modal. Right now users can add a book with empty title, author and category.
It's generally better to keep components & their respective css modules in the same place. Something like:
components/
Table/
Table.js
Table.module.css
It'll be more manage-able when your project grows.
.button {
color: red;
}
:global(.theme-provider.dark) button {
color: white;
}
... which you should be able to do in ThemeProvider
.
For example, right now Table
and DeleteBookButton
are sitting at the same level, even though Table
renders DeleteBookButton
and DeleteBookButton
is not being used anywhere else. You can structure them like this:
components/
Table/
Table.js
DeleteBookButton.js
OR
components/
Table/
Table.js
components/
DeleteBookButton.js
Having a good component structure will help you visualize the hierarchy of the components better, which in turns improves readability.
deleteBookModal
-> openDeleteBookModal
addBookModal
-> openAddBookModal
Naming should be precise & accurate to what it represents.
Modal
component right now is too busy. It should be broken down into smaller modal components.
Live demo: https://bookstore-assignment-2.vercel.app/
Main features: