Skip to content

Commit 50e69c0

Browse files
committed
Button element added but it's not functioning yet
1 parent 01d7ec8 commit 50e69c0

5 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/components/App/App.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ 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";
78

89
const App = () => (
910
<div className="app">
@@ -15,7 +16,7 @@ const App = () => (
1516
</div>
1617
<Bookings />
1718
<Restaurant />
18-
19+
<RestaurantButton OrderOne={Restaurant().OrderOne}/>
1920
<Deck />
2021

2122
<Footer

src/components/Restaurant/Restaurant.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useState } from "react";
33
function Restaurant() {
44
const [pizzas, setPizzas] = useState(0);
55

6-
function OrderOne() {
6+
const OrderOne = () => {
77
setPizzas(pizzas + 1);
88
}
99

@@ -13,9 +13,6 @@ function Restaurant() {
1313
<ul className="restaurant__list">
1414
<li className="restaurant__item">
1515
Pizzas: {pizzas}{" "}
16-
<button className="button restaurant__button" onClick={OrderOne}>
17-
Add
18-
</button>
1916
</li>
2017
</ul>
2118
</section>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
function RestaurantButton({ OrderOne }) {
3+
return (
4+
<>
5+
<button type="button" className="button restaurant__button" onClick={OrderOne}>
6+
Add Pizzas
7+
</button>
8+
</>
9+
);
10+
}
11+
12+
export default RestaurantButton

src/components/RestaurantButton/RestaurantButton.scss

Whitespace-only changes.

src/components/RestaurantButton/RestaurantButton.test.jsx

Whitespace-only changes.

0 commit comments

Comments
 (0)