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

assigment by shivamg11000(shivam gupta) #5

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

Conversation

shivamg11000
Copy link

done the assignment, took the same idea of e-commerce and implemented it.

@upa8
Copy link
Member

upa8 commented Jul 27, 2017

Good Job @shivamg11000.

We will review it after the contest.

Copy link

@akshaynaik404 akshaynaik404 left a comment

Choose a reason for hiding this comment

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

Convert components using Class syntax to Stateless functional Components and use camelcase naming convention.

import React from 'react';
import './Cart.css';

class Cart extends React.Component{

Choose a reason for hiding this comment

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

This Component can be converted to a Stateless Functional Component. Just like the others. For more info Click Here

}

handleAddToCart(itemKey){
const no_of_cart_items = this.state.cart.no;

Choose a reason for hiding this comment

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

Camel case is preferred in JavaScript based projects. Corresponding Airbnb style guide rule

Copy link
Author

Choose a reason for hiding this comment

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

I know but for such big variables snake case is more readable

Choose a reason for hiding this comment

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

What do you think about this react lifecycle method then - `componentWillReceiveProps()'?

Copy link
Author

Choose a reason for hiding this comment

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

ofcourse we have to use it , snakecase will not work here

Choose a reason for hiding this comment

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

I was trying to convey that "componentWillRecieveProps" is long variable name and yet camel case is used here.




class OrderSummary extends React.Component{

Choose a reason for hiding this comment

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

This class can also be converted to Stateless functional component.


import './Shop.css';

class Shop extends React.Component{

Choose a reason for hiding this comment

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

This class can also be converted to a Stateless functional components


import './ShopItem.css';

class ShopItem extends React.Component{

Choose a reason for hiding this comment

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

Convert all classes that either does not have state or won't have state in future, to a stateless functional component.

Copy link
Contributor

@javascripters2015 javascripters2015 left a comment

Choose a reason for hiding this comment

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

Please add comment wherever required to understand the code implementation intention
Make code more readable
Update README file with all required instruction to setup project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants