Skip to content

Conversation

@horidon
Copy link
Collaborator

@horidon horidon commented Jul 18, 2018

No description provided.

Balashov Nikita added 3 commits July 18, 2018 18:31
const uniqueLetters = new Set();

turnStrToArray.forEach(letter => {
uniqueLetters.add(letter);
Copy link
Member

Choose a reason for hiding this comment

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

А разве нет способа добавить в Set, проще?


];

const footerTabs = [
Copy link
Member

Choose a reason for hiding this comment

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

it's not the data, it just a static part of the content and it's not required to virtualize it

'Add user'
];

const idOfIcons = [
Copy link
Member

Choose a reason for hiding this comment

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

the same about icons

return document.createElement(tagName);
},

setClass(target, className) {
Copy link
Member

Choose a reason for hiding this comment

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

I like that decomposition with a lot of helpers.
I guess that methods should be moved to some other class or factory and make it like a helpers or so

const nav = this.newElem('nav');
this.setClass(nav, 'main-nav');

footerTabs.forEach((tab, index) => {
Copy link
Member

Choose a reason for hiding this comment

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

please make footer is static

const tabContent = this.newElem('span');

this.setClass(link, 'tab');
this.setClass(icon, `glyphicon glyphicon-${idOfIcons[index]}`);
Copy link
Member

Choose a reason for hiding this comment

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

it's not good to have a dependency to index

For future probably in such case, you should rename idOfIcons -> sortedIdOfIcons because of they depend on order

this.createMainContent();
this.createFooter();

document.body.appendChild(this.header);
Copy link
Member

Choose a reason for hiding this comment

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

it will be better if you do not create a header inside such methods but return them.

It's not obvious if this.main mutating during another creator the same idea behind this.header and this.footer

'plus'
];

const contactPage = {
Copy link
Member

Choose a reason for hiding this comment

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

you know it worth to make it as class and name it something like

class ContactsPage


const contentForThead = ['Name', 'Last Name', 'Email'];

const users = [
Copy link
Member

Choose a reason for hiding this comment

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

please move all logic relates to PhoneBook to another directory and work on it independently from home tasks

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.

3 participants