Skip to content

Conversation

@MpiloMshengu
Copy link
Collaborator

No description provided.

this.handleChecked=this.handleChecked.bind(this);
this.Color=this.Color.bind(this)
}
onChange(e){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just add a space in between these function declarations and look a the scss file the indentations and empty lines spaces are inconsistent

URLs should be added to const variables and be kept in a const file

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I created constants file for product and in that file, there is const variable for url. I imported constants file on product and use the const variable for url instead of actual url.

display: flex;
flex-grow: 10;
}
label {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Styling elements mean it will be applied to all elements of this type. This could make future development difficult rather make use of classes and or identifiers instead of styling an element directly

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have changed the element to classsname for styling.

<div className="col-12 marginTop10px">
<label >Size</label>
</div>
<div className="col-12 marginTop10px">
Copy link

@CeeyarRbt CeeyarRbt Feb 15, 2019

Choose a reason for hiding this comment

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

use correct way to name css class-names
marginTop10px

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah its bootstrap classes

constructor(props){
super(props);
this.state ={
Name:'',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Keep a consistent naming convention.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

now my naming is consistent.

.then(response=>response.json());
}

Color()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Choose a specific style for your function declaration.
Color(){}
or

Color()
{
}

On top of it, avoid leaving an empty line between your parentheses and your curly brackets

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i have changed the style of function declaration to
color()
{
}

{
if(this.state.color==false){
this.setState({color:true});
this.setState({ColourOption:1})
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can set the state in the same object

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this one is sorted now

{
if(this.state.small==false)
{
this.setState({small:true});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Set state in the same object

<div className="col-12 cover-image">
<label >Cover Image</label>
<span>
<input name="file" type="file" onChange={this.handleChage}/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

this.handleChage if you spelled it correctly is not visible in your constructor.
Please add it there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed handleChange function. now its sorted

Copy link
Collaborator

@laurent-mbuyu laurent-mbuyu left a comment

Choose a reason for hiding this comment

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

Please do apply the requested comments

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.

5 participants