Skip to content

Instantly share code, notes, and snippets.

@codingnninja
Last active August 7, 2019 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingnninja/830d2567e31f947e9b795d2289416a64 to your computer and use it in GitHub Desktop.
Save codingnninja/830d2567e31f947e9b795d2289416a64 to your computer and use it in GitHub Desktop.
Display food items
render() {
const { cost, food, foodItems, editing } = this.state;
return (
<div className="App">
<div className="row App-main">
<FoodItemList
foodItems= {foodItems}
deleteFoodItem={this.deleteFoodItem}
boughtFoodItem={this.boughtFoodItem}
editFoodItem={this.editFoodItem}
/>
</div>
<div className="row App-main">
{
editing ? (
<EditFoodItemForm
food={this.state.food}
cost={this.state.cost}
handleInputChange={this.handleInputChange}
setEditing={this.setEditing}
updateFoodItem={this.updateFoodItem}
/>
) : (
<AddFoodItemForm
food={this.state.food}
cost={this.state.cost}
handleInputChange={this.handleInputChange}
addFoodItem={this.addFoodItem}
/>
)
}
</div>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment