Skip to content

Commit 783aa61

Browse files
committed
2 parents 713c9a6 + 0b15ede commit 783aa61

12 files changed

Lines changed: 53 additions & 26 deletions

File tree

src/components/App/App.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ const App = () => (
1515
</div>
1616
<Bookings />
1717
<Restaurant />
18-
1918
<Deck />
20-
2119
<Footer
2220
details={[
2321
"123 Fake Street, London, E1 4UD",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Logo from "@/assets/spa-logo.png";
1+
import Logo from "@/assets/hotel-logo.png";
22
import "./AppHeader.scss";
33
const AppHeader = () => <img className="LogoImg" src={Logo}></img>;
44
export default AppHeader;

src/components/Order/Order.jsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { useState } from "react";
2+
import RestaurantButton from "../RestaurantButton/RestaurantButton";
3+
4+
function Order({orderType}) {
5+
const [pizzas, setPizzas] = useState(0);
6+
7+
const OrderOne = () => {
8+
setPizzas(pizzas + 1);
9+
};
10+
return (
11+
<>
12+
<li className="restaurant__item">{orderType}: {pizzas} </li>
13+
<RestaurantButton OrderOne={OrderOne} />
14+
</>
15+
);
16+
}
17+
18+
export default Order

src/components/Order/Order.scss

Whitespace-only changes.

src/components/Order/Order.test.jsx

Whitespace-only changes.

src/components/Restaurant/Restaurant.jsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
1-
import { useState } from "react";
1+
import Order from "../Order/Order";
22

33
function Restaurant() {
4-
const [pizzas, setPizzas] = useState(0);
5-
6-
function buttonAdd() {
7-
setPizzas(pizzas + 1);
8-
}
9-
104
return (
115
<section className="restaurant">
126
<h3 className="restaurant__heading">Restaurant Orders</h3>
137
<ul className="restaurant__list">
14-
<li className="restaurant__item">
15-
Pizzas: {pizzas}{" "}
16-
<button className="button restaurant__button" onClick={buttonAdd}>
17-
Add
18-
</button>
19-
</li>
8+
<Order orderType={"Pizzas"} />
9+
<Order orderType={"Salads"} />
10+
<Order orderType={"Chocolate Cake"} />
2011
</ul>
2112
</section>
2213
);
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
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.

src/components/SearchResult/SearchResult.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ function SearchResult() {
1818
"day"
1919
);
2020
return (
21-
<>
2221
<TableBody
2322
key={book.id}
2423
id={book.id}
@@ -31,12 +30,11 @@ function SearchResult() {
3130
checkOutDate={book.checkOutDate}
3231
stayNights={stayNightsTotal}
3332
/>
34-
</>
3533
);
3634
})}
3735
</tbody>
3836
</table>
3937
);
4038
}
4139
export default SearchResult;
42-
console.log(SearchResult());
40+

0 commit comments

Comments
 (0)