-
Notifications
You must be signed in to change notification settings - Fork 0
020 implement data from new api #24
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?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
101d513 to
093f64d
Compare
| <div className="card-label__head__legend"> | ||
| <div className="card-label__head__legend__info"> | ||
| <h3>{state.profile.name}<br/><a href={state.profile.html_url}>@{state.profile.login}</a></h3> | ||
| <h3>{state.profile.name || 'no name user :('}<br/><a href={state.profile.url}>@{state.profile.login}</a></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.
| <h3>{state.profile.name || 'no name user :('}<br/><a href={state.profile.url}>@{state.profile.login}</a></h3> | |
| <h3>{state.profile.name || 'No user name :('}<br/><a href={state.profile.url}>@{state.profile.login}</a></h3> |
| <p>Gists</p> | ||
| <p>{state.profile.publicGistsCount}</p> | ||
| </div> | ||
| <div className="data-box__info"> | ||
| <p>Followers</p> | ||
| <p>{state.profile.followers}</p> | ||
| <p>{state.profile.followersCount}</p> | ||
| </div> | ||
| <div className="data-box__info"> | ||
| <p>Following</p> | ||
| <p>{state.profile.following}</p> | ||
| <p>{state.profile.followingsCount}</p> |
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.
imo these <p> tags should be <span> because they are not actually paragraphs
| <div className={`git-card-footer__element${state.profile.twitter ? '' : '-null'}`}> | ||
| <Twitter /> | ||
| <p>{state.profile.twitter_username || 'Not Available'}</p> | ||
| <p>{state.profile.twitter || 'Not Available'}</p> |
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.
same here
| if(!reposList) setReposList(repos(state)) | ||
| } | ||
|
|
||
| if(state.repos) { |
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.
I think it would be easier to understand if you say
if (!state.repos) return null
return (
THE COMPONENT
)
instead of wrapping the actual component in a if clause and at the end return null in any other case
| payload: curatedRepos, | ||
| }) | ||
| const response = res.data | ||
| console.log(res.data) |
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.
remove console.log?
| }) | ||
| const response = res.data | ||
| console.log(res.data) | ||
| if(response.profile == null) { |
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.
Is it really necessary to use ==? Also is it necessary to compare with null? Is if(response.profile) enough?
| if(response.profile == null) { | |
| if(response.profile === null) { |
| ) | ||
| } | ||
|
|
||
| return null |
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.
Codacy has a fix for the issue: Insert ;
| return null | |
| return null; |
| if(!reposList) setReposList(repos(state)) | ||
| } | ||
|
|
||
| if(state.repos) { |
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.
Codacy has a fix for the issue: Insert ·
| if(state.repos) { | |
| if (state.repos) { |
| type: 'RESULT_OF_REPOS', | ||
| payload: curatedRepos, | ||
| }) | ||
| const response = res.data |
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.
Codacy has a fix for the issue: Insert ;
| const response = res.data | |
| const response = res.data; |
| return ( | ||
| <div className = {`error-message`}> | ||
| <h4>ERROR!</h4> | ||
| <h4>{state.message ? `Error: ${state.message}` : 'ERROR!'}</h4> |
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.
Codacy has a fix for the issue: Replace 'ERROR!' with "ERROR!"
| <h4>{state.message ? `Error: ${state.message}` : 'ERROR!'}</h4> | |
| <h4>{state.message ? `Error: ${state.message}` : "ERROR!"}</h4> |
| repos: payload, | ||
| }, | ||
| 'ADD_REPO': { | ||
| 'LOAD_RESULTS': { |
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.
Codacy has a fix for the issue: Replace 'LOAD_RESULTS' with LOAD_RESULTS
| 'LOAD_RESULTS': { | |
| LOAD_RESULTS: { |
| }) | ||
| const response = res.data | ||
| console.log(res.data) | ||
| if(response.profile == null) { |
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.
Codacy has a fix for the issue: Insert ·
| if(response.profile == null) { | |
| if (response.profile == null) { |
| }) | ||
| } else { | ||
| dispatch({ | ||
| type: 'LOAD_RESULTS', |
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.
Codacy has a fix for the issue: Replace 'LOAD_RESULTS' with "LOAD_RESULTS"
| type: 'LOAD_RESULTS', | |
| type: "LOAD_RESULTS", |
This PR: