Skip to content

Commit 13d39f1

Browse files
committed
Button is now working
1 parent 50e69c0 commit 13d39f1

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/components/App/App.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Footer from "../Footer/Footer";
44
import Deck from "../Deck/Deck";
55
import AppHeader from "../AppHeader/AppHeader";
66
import Restaurant from "../Restaurant/Restaurant";
7-
import RestaurantButton from "../RestaurantButton/RestaurantButton";
87

98
const App = () => (
109
<div className="app">
@@ -16,7 +15,6 @@ const App = () => (
1615
</div>
1716
<Bookings />
1817
<Restaurant />
19-
<RestaurantButton OrderOne={Restaurant().OrderOne}/>
2018
<Deck />
2119

2220
<Footer

src/components/Restaurant/Restaurant.jsx

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

34
function Restaurant() {
45
const [pizzas, setPizzas] = useState(0);
56

67
const OrderOne = () => {
78
setPizzas(pizzas + 1);
8-
}
9+
};
910

1011
return (
1112
<section className="restaurant">
1213
<h3 className="restaurant__heading">Restaurant Orders</h3>
1314
<ul className="restaurant__list">
14-
<li className="restaurant__item">
15-
Pizzas: {pizzas}{" "}
16-
</li>
15+
<li className="restaurant__item">Pizzas: {pizzas} </li>
1716
</ul>
17+
<RestaurantButton OrderOne={OrderOne} />
1818
</section>
1919
);
2020
}

0 commit comments

Comments
 (0)