-
Notifications
You must be signed in to change notification settings - Fork 7
DMYTRO_DORONIN-w2-React #17
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?
DMYTRO_DORONIN-w2-React #17
Conversation
robvk
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.