@Kijimai
Posted
Hello again Sloth!
I really like the idea of adding the loading message as the user waits for fetch API to grab the user information so that slower internet speeds know at least that their input was being received and handled.
I chose to store the theme in the user's local storage in the case that they decide to return to the app in the future, it saves their original preference.
As far as the error handler issue that you have, I personally used state management to store and initialize an object containing a boolean and an empty placeholder String message.
const [error, setError] = useState({show: false, message: ""})
The main difference is that I can change the message to fit the necessary error type instead of hardcoding "No Result" to the page and showing it based on if the error state was set to true or not.
Some minor things on the app and its styling: Of course the main dashboard element is missing the box-shadow present in the design but of course, that can be left up to designer preference :D React Router may be unnecessary for this particular challenge since it isn't really sending the user to a different route other than the main page for displaying the user they search for.
Excellent work on this project! I hope you can make use of some of my suggestions and make even better projects in the future too, I sure learned a lot from looking over your submission!
Marked as helpful
@Sloth247
Posted
@Kijimai Thank you very much for your feedback! I haven't put the codes for user preference of theme, so I definetely work on that from now!
Your statemanagement idea sounds interesting, I have never tried and learnt but I will try it.
Yeah your're right, I don't need to set router in this project but I tried to use searchParams to make the url change everytime showing different user. However I don't think that's necessary in this project.
Your comments are helpful and I am looking forward to see your future projects too.