Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Давай посмотрим качество кода #3

Closed
wants to merge 1 commit into from

Conversation

psywalker
Copy link
Owner

No description provided.

@@ -0,0 +1,24 @@
let nextListId = 3
Copy link
Collaborator

Choose a reason for hiding this comment

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

Давай-ка этот инкремент выпилим, и лучше добавим функцию генерации уникального id, вроде такого https://www.npmjs.com/package/uniqid

let nextListId = 3

export const addList = text => ({
type: 'ADD_LIST',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Текстовые литералы определяющие тип экшена вроде 'ADD_LIST' лучше вынеси в отдельные константы экспортируемые, ведь ты их используешь больше чем в одном месте

@@ -0,0 +1,58 @@
import React, { Component } from 'react';
import BoardsListContainer from '../../containers/BoardsListContainer'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Не сейчас может быть, но почитай про алиасы вебпака, которые позволяют определить корневой путь у проекта для импортов, чтобы вместо '../../containers / писать Сontainers/, например

{ !addListForm && (<button className="board-adding__btn" onClick={this.openFormAddList}>+ Добавьте ещё одну колонку</button>)}
{ addListForm && (<form className="board-adding-form">
<input ref={el => this.inputTitle = el} className="board-adding-form__input" placeholder="Ввести заголовок списка" />
<button className="board-adding-form__btn_add" onClick={(e) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Никаких лямбд

<div className="board-adding">
{ !addListForm && (<button className="board-adding__btn" onClick={this.openFormAddList}>+ Добавьте ещё одну колонку</button>)}
{ addListForm && (<form className="board-adding-form">
<input ref={el => this.inputTitle = el} className="board-adding-form__input" placeholder="Ввести заголовок списка" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ref не поправил

@StGeass StGeass closed this Mar 8, 2019
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.

None yet

2 participants