Skip to content

Commit 0b15ede

Browse files
authored
Merge pull request #41 from areebsattar/OrderType
NW-6 | AREEB-SATTAR | REACT| React Module Project - OrderType | WEEK-2
2 parents 2c6c9fc + 8c33bfa commit 0b15ede

6 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/components/App/App.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const App = () => (
1616
<Bookings />
1717
<Restaurant />
1818
<Deck />
19-
2019
<Footer
2120
details={[
2221
"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: 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
);

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)