Skip to content

Week1#7

Closed
chichiglacierz wants to merge 5 commits into
foocoding:masterfrom
chichiglacierz:Week1
Closed

Week1#7
chichiglacierz wants to merge 5 commits into
foocoding:masterfrom
chichiglacierz:Week1

Conversation

@chichiglacierz
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Collaborator

@mattiaslundberg mattiaslundberg left a comment

Choose a reason for hiding this comment

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

Missing two things (other comments are nice to have/fix later but optional):

  1. Create the link (there are some pointers in the comment)
  2. Load repo information when the page loads (let me know if you need more pointers for this!)

Almost

Comment thread homework/index.js
createAndAppend('pre', root, { text: JSON.stringify(data, null, 2) });
//createAndAppend('pre', root, { text: JSON.stringify(data, null, 2) });
const header = createAndAppend('header', root, { class: 'header' });
const h1 = createAndAppend('h1', header, { text: 'FooCoding Repos', class: 'h1' });
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice usage of createAndAppend!

Comment thread homework/index.js
const h1 = createAndAppend('h1', header, { text: 'FooCoding Repos', class: 'h1' });

const select = createAndAppend('select', root, { class: 'select' });
createAndAppend('option', select, { text: 'Choose your favorite repo below:' });
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One of the requirements is that information for the first repo is shown when the page loads, can you have a look at that?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Trying...

Comment thread homework/index.js Outdated
data.forEach(repo => {
const name = repo.name;
createAndAppend('option', select, { text: name });
//console.log(name);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't leave commented out code, remove it! It's easier for me to review and easier for you to read when you come back to it at a later time.

Comment thread homework/index.js Outdated
addInfo('Description: ', repo.description);
addInfo('Number of forks: ', repo.forks);
addInfo('Updated: ', repo.updated_at);
//or instead of using the addInfo function we can use these lines:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To create a link:
createAndAppend('a', repoInfo, {text: label, href: url})

Comment thread homework/index.js Outdated
}
contribData.forEach(contributor => {
createAndAppend('div', contribs, { text: contributor.login });
//createAndAppend('a', contribs, { href: contributor.html.url, setAttribute: 'href' });
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the issues here are:

  1. contributor.html.url should be contributor.html_url
  2. you need to add text: contributor.login

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

So that's why it wasn't working. Thanks!

Comment thread homework/index.js
contribData.forEach(contributor => {
createAndAppend('div', contribs, { text: contributor.login });
//createAndAppend('a', contribs, { href: contributor.html.url, setAttribute: 'href' });
createAndAppend('img', contribs, {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice!

@chichiglacierz chichiglacierz deleted the Week1 branch August 31, 2019 17:05
@chichiglacierz chichiglacierz restored the Week1 branch August 31, 2019 17:05
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