Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Conversation

@end0620
Copy link

@end0620 end0620 commented Sep 4, 2018

No description provided.

@profxed
Copy link

profxed commented Sep 4, 2018

Hey @end0620, Nice to see your third week homework 🙂, I saw that you did it with classes, I am going to eat something and coming back to review it tonight 😃

Copy link

@profxed profxed left a comment

Choose a reason for hiding this comment

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

Excellent 💯

Hey @end0620, I am so happy that I see your hard work shows up 🙂, you have a very good grasp on javascript 💯.
I left for you some comments for js may help improve your hard work 💪 .

You still don't have any serious issues with your code unless the responsively design 💔 such as:

  • best cases in a mobile screen:
    screen shot 2018-09-05 at 07 32 20
  • but on 326X522
    screen shot 2018-09-05 at 07 32 09
  • same as the previous but in landscape mode.
    screen shot 2018-09-05 at 07 31 54

@@ -0,0 +1,66 @@
'use strict';

Copy link

Choose a reason for hiding this comment

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

Your Application is not an asset !!

try {

const repos = await Util.fetchJSON(url);
repos.sort((repo1, repo2) => {
Copy link

Choose a reason for hiding this comment

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

Nice using of .sort 💯


try {
const repo = this.repos[index];
repo.render(document.getElementById('content'));
Copy link

Choose a reason for hiding this comment

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

you could call document.getElementById('content') a content for readability.

}

render(contributorList) {
console.log(contributorList);
Copy link

Choose a reason for hiding this comment

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

console.log ??

@@ -0,0 +1,66 @@
'use strict';

Copy link

Choose a reason for hiding this comment

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

I see that you have to separate your files yes But you should at least mention that which files are for what !!

As I saw it's same as the one in the assets folder...

Util.createAndAppend('a', item1, {html: this.data[repoValues[index]], href: this.data.url, target: '_blank'});
else if(element === 'Updated')
{
let myDate = new Date(this.data[repoValues[index]]);
Copy link

Choose a reason for hiding this comment

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

Could updatedDate have a better meaning instead of myDate ??

Util.createAndAppend('h4', item1, {html: myDate.toLocaleString()});
}
else
Util.createAndAppend('h4', item1, {html: this.data[repoValues[index]]});
Copy link

Choose a reason for hiding this comment

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

I saw that you are using this.data[repoValues[index]] multiple times, so what you can do is inserting it inside a variable that will declare the idea of it and will make your code much shorter.

});
}


Copy link

Choose a reason for hiding this comment

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

Two empty lines makes the Idea of a new complete section going to be here.

const repoLabels = ['Repository', 'Description', 'Forks', 'Updated'];
const repoValues = ['name', 'description', 'forks', 'updated_at'];
function renderRepo(repo)
{
Copy link

Choose a reason for hiding this comment

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

As the code structure comment

const contributors = document.getElementById('contribInfo');
fetchJSON(repo.contributors_url).then(function(response){
response.forEach((contributor, index)=>{
if(index >= 10) return;
Copy link

Choose a reason for hiding this comment

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

there is no really need to limit the amount of the rendered data on the screen unless you have a hundreds latterly of them.

@profxed
Copy link

profxed commented Sep 5, 2018

Oh I forgot you should be aware of your files Directory names, and you should just separate your different kind of files files.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants