-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Develop #876
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: master
Are you sure you want to change the base?
Develop #876
Conversation
danon321
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.
Jeszcze potrzebujemy linku do demo
Zibi95
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.
Well done. It works well and looks good.
Here are some minor things that i found
- these items in breadcrumb should be centered:
- placeholder and carret are missaligned
- on the phone/tablet here we lack swipe feature
- also here we are missing swipe feature
- this product category pages on mobile look bad. In mockup its different (I was taking screenshot on around +320px)
| return `${namespaceId}-${normCapacity}-${normColor}`; | ||
| }; | ||
|
|
||
| const colorMap: Record<string, string> = { |
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.
This should be places in some contstant.ts file or smth.
| let data: Product | null = null; | ||
|
|
||
| try { | ||
| const detailResponse = await fetch( |
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.
Two independent fetch requests happen sequentially, creating a waterfall. These could run in parallel.
src/context/CartContext.tsx
Outdated
| const isInCart = (productId: string | number) => | ||
| cartItems.some(item => item.id === productId); | ||
|
|
||
| const totalCount = cartItems.reduce((sum, item) => sum + item.quantity, 0); |
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.
btotalCount is recalculated on every render, not just when cartItems changes. Components subscribing to this will re-render unnecessarily.
| useEffect(() => { | ||
| localStorage.setItem('cartItems', JSON.stringify(cartItems)); | ||
| }, [cartItems]); |
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.
cartItems is an array (non-primitive), causing this effect to run on every render even if data hasn't changed.
|
Powinno być juz lepiej 🫣 |
Zibi95
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.
Some of the things are still not fixed


DEMO LINK