NewShop component

In the NewShop component, we will render a form that allows a seller to create a shop by entering a name and description, and uploading a logo image file from their local filesystem:

We will add the file upload elements using a Material-UI button and an HTML5 file input element.

mern-marketplace/client/shop/NewShop.js:

<input accept="image/*" onChange={this.handleChange('image')}        style={display:'none'} id="icon-button-file" type="file" /><label htmlFor="icon-button-file">   <Button raised color="secondary" component="span">      Upload Logo <FileUpload/>   </Button></label> <span> {this.state.image ? this.state.image.name : ''} </span> ...

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.