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

Start pull requests #1

Merged
merged 13 commits into from
Sep 13, 2018
Merged

Start pull requests #1

merged 13 commits into from
Sep 13, 2018

Conversation

untael
Copy link
Owner

@untael untael commented Sep 11, 2018

No description provided.

@untael untael self-assigned this Sep 11, 2018
@untael untael requested a review from iTechJ September 11, 2018 14:41
@untael untael changed the title Test request Start pull requests Sep 11, 2018
Copy link
Collaborator

@iTechJ iTechJ left a comment

Choose a reason for hiding this comment

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

Код просмотрел. Мелочи указал. Общая картина будет с нарастанием функционала. Лучше делать более частые и мелкие пул реквесты.
Из общих рекомендаций:
Весь закомиченный код должен не кидать ворнингов. Так как это значит с большой вероятностью, что где-то ошибка.

"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

axios отлично справляется с задачей, но нативный fetch ничем не хуже и ничего не надо подключать, просто на будущее

<div>
<h2>Home</h2>
</div>
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Понятно что это всё ещё будешь перелопачивать), но просто напоминание, что для чистоты только один компонент в одном файле

about: undefined,
image: undefined,
},
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Не вижу смысла инициализировать переменные undefined. То же самое что не инициализировать

this.handleInputChange = this.handleInputChange.bind(this)
this.handleSubmit = this.handleSubmit.bind(this)
this.closeCreate = this.closeCreate.bind(this)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

facebook/react#9851
В кратце есть bind или arrow functions. Второй подход предпочитаю больше так как меньше писать => меньше багов

const target = event.target
const value = target.value
const name = target.name
if (value !== '') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

если нет чёткой необходимости можно заменить на if (value) {

}

handleUploadFile () {
const fileInput = document.getElementById('file')
Copy link
Collaborator

Choose a reason for hiding this comment

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

использование id опасно, а если надо 2 одинаковых компонента нарисовать и у обоих одна id?

}

handleSubmit () {
if ((this.state.contact.name === undefined || '') || (this.state.contact.surname === undefined || '')) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

тоже самое, необходима ли тут явнfя проверка на пусткю строку и undefined?

display: flex;
}

@media screen and (max-width: 600px) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Лучше юзать mobile first https://zellwk.com/blog/how-to-write-mobile-first-css/ Так как на мобилках открывают больше и они слабее. А медиа квери для больших размеров, а не наоборот

Personal information:
</div>
<div className="contact-display__container__close-button">
<img alt="img" src={require('../Popup/icons/close.png')} onClick={this.closeDisplay}></img>
Copy link
Collaborator

Choose a reason for hiding this comment

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

почему не import сверху?

import Toast from '../Popup/toast'
import popup from '../Popup/popup.css'

class ContactEditForm extends React.Component {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Edit и CreateForm оч похожи, возможно можно реюзать

@untael untael merged commit 955eeb0 into master Sep 13, 2018
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