DMYTRO_DORONIN-w2-React#17
Conversation
robvk
left a comment
There was a problem hiding this comment.
Nice work as usual, great to see that you are doing some extra things to hopefully challenge yourself a little ;).
- I like the functionality split, having api separate is a nice way of doing it. Arguments I have heard against this structure is that it separates code for the same feature from each other. But that is a preference thing I would say.
- The formatting seems off in your project. Check that prettier is running and formatting your code. See Layout.tsx for an example where it is definitely not formatted the prettier way
- What you call Notification is usually called Toast. A Notification is this:
- Your toast system shows me 2 errors if I am offline. Steps I took: go to the main page, go offline, then click on a detail page (1 error), then click back and I see 2 errors:
Make sure you fix the double error problem, the rest is all purely for information. I don't expect you to do all of that, is for the next time. As such, I will approve it, I assume you can find out the double error on your own ;)
Nice work
| <span className={`${styles.glow} ${styles['glow-bright']} ${styles['glow-bottom']}`}></span> | ||
| <div className={styles.inner}> | ||
| <img className={styles['card-img']} src={image} alt={title}/> | ||
| <h3>{replaceFake(title)}</h3> |
There was a problem hiding this comment.
Do you still need the replaceFake function?
| const [data, setData] = useState<T | null>(null) | ||
| const [error, setError] = useState<string | null>(null) | ||
| const { notify } = useNotification() | ||
| const request = useCallback( |
There was a problem hiding this comment.
A question you may get during interviews is why you use a useCallback here. What would be your answer?
| loading: categoriesLoading, | ||
| } = useFetch(getAllCategories) | ||
|
|
||
| const [currentCategory, setCurrentCategory] = useState<categoriesType>('All') |
There was a problem hiding this comment.
You use 'All' a lot in different parts now. Maybe it is better to make it a constant now to ensure it remains the same
No description provided.