-1

Need code review for my work on below requirement. Your comments help me improve.

I'm using https://developer.github.com/v3 documentation for api's.

The application should have two views to display user data:

  1. List of most recent Github users. Make sure you at least show the following information for the user list
    • Profile Avatar
    • Handle (username)
    • Clicking on any user should show a detailed view about that user
  2. Detailed view. Make sure you at least show the following information for the user list
    • Name
    • Larger Version of Profile Avatar
    • Handle
    • Location
    • Bio
    • Following count
    • Follower count

CodeSandbox: https://codesandbox.io/s/elastic-goldwaser-nn047

frontEnd
  • 31
  • 5

1 Answers1

0

Overall this is very well done, here are a few minor pointers

  1. Create a directory views or components and throw users.jsx and userDetails.jsx in there
  2. You are wrapping <BrowserRouter> twice in index.js and app.js. You could wrap your routes with a <Switch> statement instead in the app.js file.
  3. You have a getUsersDetail method in users.js but it's not being called or passed as props.

Lastly, it looks like you're making an API call but you also have dummy data in json file, not clear how they're interacting in the http.js file.

Hyetigran
  • 760
  • 7
  • 18
  • Thanks @Hyetigran!! I had dummy JSON as alternative if the services fail while developing. What benefit we get using instead of ?? – frontEnd Jul 06 '20 at 18:09
  • You'll still need the `BrowserRouter` but adding also adding `Switch` it will ensure only 1 route is returned. First answer goes into better detail here: https://stackoverflow.com/questions/45122800/react-router-switch-behavior – Hyetigran Jul 06 '20 at 19:49