Skip to content

Github tracker for Anna Thunberg#53

Open
annatbg wants to merge 9 commits intoTechnigo:mainfrom
annatbg:main
Open

Github tracker for Anna Thunberg#53
annatbg wants to merge 9 commits intoTechnigo:mainfrom
annatbg:main

Conversation

@annatbg
Copy link
Copy Markdown

@annatbg annatbg commented Oct 3, 2021

GitHub Tracker

A site that keeps track of my Github repositories.
The project name (with url), latest push, number of commits and pull request is fetched from the Github API, along with my profile info.

The problem

I fetched all my repos and used the filter method to only keep the ones forked from Technigo that start with "project".
I fetched the other data using a similar method, either directly from the API if possible, and filtered it when necessary.
For sorting the repos in order by date, I used a function that I found on stack overflow to avoid a lot of issues with dates in js.

My plan was to use grid for my layout, however, that part is NOT complete yet (as of deadline) and I will keep working on it.
The page works on different devices, but I plan to make the project-divs look more unified in height.

View it live

https://annathunberg-githubtracker.netlify.app/

Copy link
Copy Markdown

@hejmaria hejmaria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! You fulfill all the requirements and the GitHub tracker works. Your code is clean and readable, and your design is personal as always. Thanks for an inspiring site!

<h2>Projects:</h2>
<main id="projects"></main>


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Airy code - but I like it!


<div id="list"></div>

</div> <!--closing tag grid item-->
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great reminder! I should use comments like these more often. It is so easy to delete the wrong one ><

avatar.src = data.avatar_url
})

// FETCHES MY REPOS
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the clean headings to comment your code. Makes it very readble.

.then((data) => {
const myPullRequests = data.filter((pullRequest) => pullRequest.user.login === USER);
// IF ELSE STATEMENT FOR 0 PULLS?
document.getElementById(`pull-request-${repo.name}`).innerHTML = `Pull requests: ${myPullRequests.length}`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have solved this in another way than Maks (or was it jennie?) showed us. I actually like yours better. It is more understandable when you visit the site.

</div>`
}

// SORTS THE REPOS IN CHRONOLOGICAL ORDER BY DATE
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The famous sorting function! I used it as well :) Maybe reverse the order to get the latest and most advanced project first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants