- 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
Hw 1 #1
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
        
          
                homeworks/homework-1/src/main.js
              
                Outdated
          
        
      |  | ||
| const main = props.data.users.map ((item, i) => { | ||
|  | ||
| let {avatarUrl, fullName, ...rest} = item; | 
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 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"> | 
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.
please fix formatting
        
          
                homeworks/homework-1/src/main.js
              
                Outdated
          
        
      | return ( | ||
| <div className="panel panel-info"> | ||
|  | ||
| <RenderTable data = {props}/> | 
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.
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) => { | 
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.
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}/> | 
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.
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> | 
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.
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> | 
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.
same about props.data
        
          
                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"/> | 
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.
please update props/data
        
          
                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'; | 
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.
*.styl ? :) well done
without copying of block