Skip to content

Commit dd79644

Browse files
committed
OrderType completed as well
1 parent 7b1730f commit dd79644

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/components/Order/Order.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { useState } from "react";
22
import RestaurantButton from "../RestaurantButton/RestaurantButton";
33

4-
function Order() {
4+
function Order({orderType}) {
55
const [pizzas, setPizzas] = useState(0);
66

77
const OrderOne = () => {
88
setPizzas(pizzas + 1);
99
};
1010
return (
1111
<>
12-
<li className="restaurant__item">Pizzas: {pizzas} </li>
12+
<li className="restaurant__item">{orderType}: {pizzas} </li>
1313
<RestaurantButton OrderOne={OrderOne} />
1414
</>
1515
);

src/components/Restaurant/Restaurant.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ function Restaurant() {
55
<section className="restaurant">
66
<h3 className="restaurant__heading">Restaurant Orders</h3>
77
<ul className="restaurant__list">
8-
<Order />
8+
<Order orderType={"Pizzas"} />
9+
<Order orderType={"Salads"} />
10+
<Order orderType={"Chocolate Cake"} />
911
</ul>
1012
</section>
1113
);

src/components/RestaurantButton/RestaurantButton.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function RestaurantButton({ OrderOne }) {
33
return (
44
<>
55
<button type="button" className="button restaurant__button" onClick={OrderOne}>
6-
Add Pizzas
6+
Add
77
</button>
88
</>
99
);

0 commit comments

Comments
 (0)