Updating the Edit Profile view

A signed-in user will see a toggle in the Edit Profile view, to either activate or deactivate the seller feature. We will update the EditProfile component to add a Material-UI Switch component in FormControlLabel.

mern-marketplace/client/user/EditProfile.js:

<Typography type="subheading" component="h4" className={classes.subheading}>    Seller Account</Typography><FormControlLabel    control = { <Switch classes={{ checked: classes.checked, bar: classes.bar}}                  checked={this.state.seller}                  onChange={this.handleCheck}                /> }    label={this.state.seller? 'Active' : 'Inactive'}/>

Any changes to the switch will be set to the value of the seller in state by calling the handleCheck method.

mern-marketplace/client/user/EditProfile.js ...

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.