-
Notifications
You must be signed in to change notification settings - Fork 36
Лисицына Александра #42
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
base: master
Are you sure you want to change the base?
Conversation
|
This pull request is automatically deployed with Now. Latest deployment for this branch: https://task5.itmo-yandex.now.sh |
| @@ -0,0 +1,33 @@ | |||
| import React, { Component } from 'react'; | |||
|
|
|||
| import './app.css'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import imageUrl from './image.png';
| <div className="option options__createdir">Создать папку</div> | ||
| </div> | ||
| </div> | ||
| <Main inputActive={this.state.inputActive} onClickLetter={() => this.clickHandlerLetter()} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Будет всегда перерендериваться
|
|
||
| // надо впихивать письма в конец, потом при рендере откусить последние 30 элементов и выводить с последнего | ||
| render() { | ||
| if (this.props.inputActive || this.state.view === -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const { inputActive } = this.props;
const { view } = this.state;
| }, | ||
| { from: 'ЯндексПаспорт', theme: 'Доступ к аккаунту', date: '5 авг', text: 'Доступ' } | ||
| ], | ||
| view: -1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не хватает семантики
| // надо впихивать письма в конец, потом при рендере откусить последние 30 элементов и выводить с последнего | ||
| render() { | ||
| if (this.props.inputActive || this.state.view === -1) { | ||
| if (this.state.view !== -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В render не должно быть side-эффектов, он должен только отдавать вёрстку
| class FullLetter extends Component { | ||
| render() { | ||
| return( | ||
| <div>{this.props.text}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Приделать кнопочку)
| }; | ||
|
|
||
| renderLetter = (letter, i) => { | ||
| if (i < 30) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше не использовать магические числа в коде
| if (this.state.view !== -1) { | ||
| this.setState({ ...this.state, view: -1 }); | ||
| } | ||
| return <div className="letters">{this.state.letters.map(this.renderLetter)}</div>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slice()
No description provided.