-
Notifications
You must be signed in to change notification settings - Fork 7
DARYNA-TKACHENKO-WEEK2-REACT #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
DARYNA-TKACHENKO-WEEK2-REACT #14
Conversation
sycons
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following were implemented:
fake-datadirectory is no longer used ✅- App connects to endpoints in the API to fetch data for categories and products ✅
- Filter the products in the API and not in the frontend ✅
- App displays loading when waiting for request to complete fetching data ✅
- App shows an error message if the request failed ✅
- Clicking on product card goes to a detail page ✅
- Detail page fetches data from an endpoint ✅
- Deploy app somewhere (like netlify) and add link to PR ✅
Great job! Added some comments on details I noticed. Your UI is responsive and sleek and you add UX touches that are really nice.
Well done on structuring your app by separating out pages and services.
| }; | ||
|
|
||
| export const fetchProducts = async (category = null) => { | ||
| const url = category |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clever implementation to use an optional parameter to determine the URL ⭐
| d="M15 19l-7-7 7-7" | ||
| /> | ||
| </svg> | ||
| Back to Products |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice UX to add this button ⭐
|
|
||
| useEffect(() => { | ||
| loadProducts(); | ||
| }, [selectedCategory]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPTIONAL: Fix linting warning React Hook useEffect has a missing dependency: 'loadProducts'. Either include it or remove the dependency array. You can run npm run lint to see this warning. Fixing this will provide a deeper understanding of the useEffect hook.
No description provided.