Last active
August 5, 2019 17:00
-
-
Save codingnninja/27a8543e079a68d7f0fc3694f58edb1e to your computer and use it in GitHub Desktop.
Edit food item
This file contains 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' | |
const EditFoodItemForm = props => { | |
return ( | |
<form className="col-sm-4"> | |
<div> | |
<div> | |
<label className="text-white">Food name</label> | |
<input type="text" name="food" value={props.food} onChange={ props.handleInputChange}/> | |
</div> | |
<div> | |
<label className="text-white">Food cost</label> | |
<input type="number" name="cost" value={props.cost} onChange={ props.handleInputChange} /> | |
</div> | |
<button onClick={ props.updateFoodItem }> Update </button> | |
<button onClick={() => props.setEditing(false)}>Cancel</button> | |
</div> | |
</form> | |
) | |
} | |
export default EditFoodItemForm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment