Repository navigation
feat: validate portfolio image correctly - #57084
Conversation
There was a problem hiding this comment.
This works well, but it shares a lot of code with the about page. Neither are entirely what we want, though - they're both rather verbose, when all we want is to make a query and see if it succeeds.
I do like the use of Promises, though, that makes life a lot easier. For instance, it lets us integrate with, say, React query, meaning we don't have to mess around with callbacks or effects.
Here's what I recommend (either in this PR or separately, doesn't matter, actually it's kinda complex so another PR would be good):
- convert these components to functions
- move the image validation logic into its own module
- use a data fetching library (the react docs have recommendations) to handle image validation requests.
|
I really don't feel like any abstraction is necessary right now. I am planning on changing these components to functional components anyway, Could we keep this for a future pr? |
Yep, absolutely. |
Checklist:
mainbranch of freeCodeCamp.Closes #49132