Things done:
- Fix router issues
- Fix categories selection issues
- Implement product Add/Update
- Implement default expiration date (30 days from the creation date)
- Check feature checkbox dynamically if the rating is above a threshold (8)
- Prevent form submit if there are erros
- Add index.js in components for a general export for more convenient importing
- Extract validator.js in a seperate folder for consistency and readability
Things to improve:
- Add typescript
- Refactor API classes to functions for consistency
- Move fetch data logic from index.jsx to component based approach (e.g. call fetch from useEffect from the component)
- In general it is a good practice to keep the render/return clean, we can extract the repeated logic (for example the input fields) and map them from a config file. Also to achieve that we should refactor the local state from having multiple setStates to only one, with object as a default value
- We can create a page folder and move more complex logic there (a page can be defined as more complex composition of componens) and keep components logic cleaner
- There are some depricated functions, we can updated depenencies and keep the code up to date if possible.