Conversation
OlegLustenko
requested changes
Sep 2, 2018
homeworks/homework-1/src/main.js
Outdated
|
|
||
| const main = props.data.users.map ((item, i) => { | ||
|
|
||
| let {avatarUrl, fullName, ...rest} = item; |
Member
There was a problem hiding this comment.
if you are not using rest no need to create extra variable
homeworks/homework-1/src/main.js
Outdated
| const UserTableBody = (props) => { | ||
|
|
||
| return ( | ||
| <table className="table table-user-information"> |
homeworks/homework-1/src/main.js
Outdated
| return ( | ||
| <div className="panel panel-info"> | ||
|
|
||
| <RenderTable data = {props}/> |
Member
There was a problem hiding this comment.
probably passing down ALL props not really good practice, it's much better to pass only required props.
for example
<RenderTable user={props.users}/>or so
homeworks/homework-1/src/main.js
Outdated
| ) | ||
| }; | ||
|
|
||
| const RenderTable = (props) => { |
Member
There was a problem hiding this comment.
that naming... I guess name it TableUsers is much better.
homeworks/homework-1/src/main.js
Outdated
| <div className="row"> | ||
|
|
||
| <div> | ||
| <UserTableAvatar data = {item.avatarUrl}/> |
Member
There was a problem hiding this comment.
you are using everywhere prop with naming data it says nothing about passed props, please improve such naming
homeworks/homework-1/src/main.js
Outdated
| <tbody> | ||
| <tr> | ||
| <td>Дата рождения</td> | ||
| <td>{props.data.birthdate}</td> |
Member
There was a problem hiding this comment.
please use object destruction to extract properties from props
and rename data in props to something meaningful
homeworks/homework-1/src/main.js
Outdated
| const UserTableHeader = (props) => { | ||
| return ( | ||
| <div className="panel-heading"> | ||
| <h3 className="panel-title">{props.data}</h3> |
homeworks/homework-1/src/main.js
Outdated
| const UserTableAvatar = (props) => { | ||
| return ( | ||
| <div className="col-md-3 col-lg-3 " align="center"> | ||
| <img src={props.data} className="pull-left"/> |
homeworks/homework-1/src/main.js
Outdated
| import ReactDOM from "react-dom"; | ||
| import {users} from "./components/users.js"; | ||
| import 'bootstrap/dist/css/bootstrap.css'; | ||
| import '../styl/index.styl'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
without copying of block