Created
May 17, 2018 08:17
-
-
Save jokamjohn/5d45ff302c90d5508a2fb57493f130ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
export const AddItem = ({name, price, onChange}) => ( | |
<div className="row justify-content-center"> | |
<form className="form-inline"> | |
<input | |
type="text" | |
className="form-control mb-2 mr-sm-2" | |
placeholder="Item" | |
value={name} | |
name="name" | |
onChange={onChange} | |
/> | |
<div className="input-group mb-2 mr-sm-2"> | |
<input | |
type="text" | |
className="form-control" | |
placeholder="Price" | |
value={price} | |
name="price" | |
onChange={onChange} | |
/> | |
</div> | |
<button type="submit" className="btn btn-primary mb-2 pxy-4">Save</button> | |
</form> | |
</div> | |
); | |
AddItem.propTypes = { | |
name: PropTypes.string.isRequired, | |
price: PropTypes.string.isRequired, | |
onChange: PropTypes.func.isRequired, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment