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

task 1 ready #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

task 1 ready #4

wants to merge 1 commit into from

Conversation

moskwajacek
Copy link

No description provided.

Copy link
Member

@mhagmajer mhagmajer left a comment

Choose a reason for hiding this comment

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

Congrats on submitting a solution to our newsletter task! 👍

I added a number of inline comments about different code issues that need to be resolved before this can be approved. Please feel free to comment on them if you need more explanation or would like to express a different opinion. I hope you find this informative. We're looking forward to seeing what you code next!

@@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"material-ui": "^0.20.1",
Copy link
Member

Choose a reason for hiding this comment

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

This is a correct way of adding a custom UI library to the project. That being said, it's best to focus on the React part of the task and only use some basic CSS styling. We should always aim at creating minimum effective pull requests. The more code we have, the harder it gets to manage it and maintain it.

Adding this also caused package-lock.json to be created which obscures the PR a little

@@ -26,3 +26,19 @@
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}

.table {
Copy link
Member

Choose a reason for hiding this comment

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

This style will apply to all the table elements in the project. This will also affect any other table that may be added in the future. Instead, you should use a class selector to differentiate the CarsDataTable elements from generic ones.

</div>
<b>Your task is to render a table here</b>
<Table carsData={props.cars}/>
<Table2Mui carsData={props.cars}/>
Copy link
Member

Choose a reason for hiding this comment

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

The task was to create just a one table 😄

<td>{ element.carMake }</td>
<td>{ element.carModel }</td>
<td>{ element.carModelYear }</td>
<td bgcolor={ element.bodyColor }>{ element.bodyColor }</td>
Copy link
Member

Choose a reason for hiding this comment

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

The bgcolor attribute is deprecated. You should use style here instead like so:

<td style={{ backgroundColor: element.bodyColor }} />

Also the hex codes are not readable by a general user - we shouldn't display them.

<td>{ element.carModel }</td>
<td>{ element.carModelYear }</td>
<td bgcolor={ element.bodyColor }>{ element.bodyColor }</td>
<td>{ element.dealerEmail }</td>
Copy link
Member

Choose a reason for hiding this comment

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

It would be great to have this email be a mailto: link.


// Component write as a function

// const Table = (props) => {
Copy link
Member

Choose a reason for hiding this comment

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

Please don't submit commented code. You should just pick one approach and use it. In this case it seem that the functional component should be the way to go.

constructor(props) {
super(props);
this.state = {
showCheckboxes: false,
Copy link
Member

Choose a reason for hiding this comment

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

Seems like there is nothing to change this state. Also this functionality, although interesting, wasn't a part of the task. We have more interesting tasks coming it, so it's best to focus entirely and exclusively at the current task at hand.

<TableRowColumn>{ element.carMake }</TableRowColumn>
<TableRowColumn>{ element.carModel }</TableRowColumn>
<TableRowColumn>{ element.carModelYear }</TableRowColumn>
<TableRowColumn style={{ backgroundColor: `${element.bodyColor}` }}>{ element.bodyColor }</TableRowColumn>
Copy link
Member

Choose a reason for hiding this comment

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

Please note that there is no need to use string template literals like ${element.bodyColor} if you don't intend to append text - just do element.bodyColor

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