Github Tracker without image(will fix)#58
Github Tracker without image(will fix)#58Groovedharry wants to merge 2 commits intoTechnigo:mainfrom
Conversation
Sorry that I didn't do commits, I forget at times when I am stressed which I was this time
Zancotti
left a comment
There was a problem hiding this comment.
Hey Harry, by the sound of the time you have had you have done a good work in finishing this project and you can be proud of yourself! Clean code btw =)
| <title>Project GitHub Tracker</title> | ||
| <link rel="stylesheet" href="./style.css" /> | ||
| <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | ||
|
|
There was a problem hiding this comment.
Just a very small detail, i would get rid of line 11 or do the same on both sides so it looks proportionate =)
| const USER = 'Groovedharry' | ||
| const REPOS_URL = `https://api.github.com/users/${USER}/repos`; | ||
| const USER_API = `https://api.github.com/users/${USER}`; | ||
| const projectsContainerXXYT = document.getElementById('profileInfo'); |
| const REPOS_URL = `https://api.github.com/users/${USER}/repos`; | ||
| const USER_API = `https://api.github.com/users/${USER}`; | ||
| const projectsContainerXXYT = document.getElementById('profileInfo'); | ||
| const projectsContainer = document.querySelector("#projects"); |
There was a problem hiding this comment.
Is there a reason why you used a querySelector here instead of just use document.getElementById? If there isnt a particular reason i would try to make it coherent and use dockument.getElementById here aswell or just use the queryselector for targeting the elements =).
| fetch(USER_API) | ||
| .then((response) => response.json()) | ||
| .then((data) => { | ||
| profile.info.innerHTML += ` |
There was a problem hiding this comment.
I would guess that this bit doesnt work since you havent targeted the correct id. you have used profile.info.innerhtml. Try to change that to profileInfo.innerHTML instead.
| .then((data) => { | ||
| profile.info.innerHTML += ` | ||
| <h2> Profile info </h2> | ||
| <img src ="https://avatars.githubusercontent.com/u/83465217?v=4" alt="profile pic"> |
There was a problem hiding this comment.
This info is possible to pick up from the data So you dont have to hard code it. It is just a suggestion since you already use the api to pcick up the name!
| const getRepos = () => { | ||
| fetch(REPOS_URL) | ||
| .then((response) => { | ||
| return response.json(); |
There was a problem hiding this comment.
Nice solution to wait until the data is finished! =)
| }) | ||
| .then((json) => { | ||
| const forkedRepos = json.filter((project) => project.fork && project.name.startsWith("project-")); | ||
| console.log(forkedRepos) |
There was a problem hiding this comment.
I would remove this console log before pushing the final result, but since you have written that you arent entirely done with the project I understand that you left it =)
| .then((json) => { | ||
| const filteredCommits = json.filter((project) => project.commit.author.name === "Harry Bäcklin"); | ||
| // makes the first letter an upper case, Thank you Bruna // | ||
| const upperCaseName = project.name.charAt(0).toUpperCase() + project.name.slice(1); |
| const myPullRequest = pulldata.find( | ||
| (pull) => pull.user.login === project.owner.login | ||
| ); | ||
| if (myPullRequest) { |
| font-size: 40px; | ||
| } | ||
|
|
||
| /* not working prolly something in JS but I can't figure it out */ |
https://app.netlify.com/sites/determined-bose-382814/overview