Created
May 17, 2018 07:57
-
-
Save jokamjohn/5356c8c9098cf658bec74b7e03652348 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}) => ( | |
<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" | |
/> | |
<div className="input-group mb-2 mr-sm-2"> | |
<input | |
type="text" | |
className="form-control" | |
placeholder="Price" | |
value={price} | |
name="price" | |
/> | |
</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, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment