Skip to content

Commit ebf66bf

Browse files
authored
Merge branch 'master' into Ben
2 parents 1fa9b5b + e10161b commit ebf66bf

File tree

4 files changed

+53
-25
lines changed

4 files changed

+53
-25
lines changed

frontend/app/components/reservation_summary.tsx

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@ import AccountBalanceOutlinedIcon from "@mui/icons-material/AccountBalanceOutlin
66
import AddToHomeScreenIcon from "@mui/icons-material/AddToHomeScreen";
77
import Line from "./line";
88

9-
function Reserv() {
9+
type ResProps = {
10+
time?: string;
11+
price?: string;
12+
};
13+
14+
function Reserv({ time, price }: ResProps) {
15+
const ResDetails = {
16+
time: time || "0",
17+
price: price || "0",
18+
};
19+
1020
return (
1121
<div>
1222
<p className=" text-textcolor text-sm font-semibold py-2 px-2 ml-7 mt-3">
@@ -15,17 +25,12 @@ function Reserv() {
1525

1626
<div className="flex text-xs ml-14 mt-2 justify-between">
1727
<div>
18-
<div className="flex font-bold">
28+
<div className="flex font-bold space-x-2">
1929
<p>Time Reserved:</p>
20-
<p>5:30 PM</p>
21-
</div>
22-
<div className="flex space-x-1">
23-
<p className="font-bold">1x</p>
24-
<p>1 hour</p>
25-
<p>(Individual Seat)</p>
30+
<p>{ResDetails.time}</p>
2631
</div>
2732
</div>
28-
<h4 className="mr-16">&#8369; 80.00</h4>
33+
<h4 className="mr-16 font-bold">&#8369; {ResDetails.price}</h4>
2934
</div>
3035

3136
<Line></Line>
@@ -35,7 +40,7 @@ function Reserv() {
3540
Subtotal Fee
3641
</p>
3742
<p className=" text-textcolor text-sm font-semibold py-2 px-2 mt-3 mr-10">
38-
&#8369; 80.00
43+
&#8369; {ResDetails.price}
3944
</p>
4045
</div>
4146

@@ -64,17 +69,6 @@ function Reserv() {
6469
title="GCash"
6570
marginRight="220px"
6671
></IcoButt>
67-
68-
<IcoButt
69-
Icon={
70-
<AddToHomeScreenIcon
71-
className="mr-3"
72-
style={{ fontSize: 28, color: "#EDC2B5" }}
73-
/>
74-
}
75-
title="Paymaya"
76-
marginRight="205px"
77-
></IcoButt>
7872
</div>
7973
);
8074
}

frontend/app/payment_details/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ function Page() {
2626
title="Payment Details"
2727
subTitle1="Select your preferred payment method"
2828
/>
29-
30-
<Reserv></Reserv>
29+
<Reserv />{" "}
30+
{/*insert values for RESERVED TIME and its PRICE inside "Reserv".. props are "time" and "price"*/}
3131
</div>
3232
);
3333
}

frontend/app/reservation/page.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,36 @@ import TemporaryDrawer from "../components/side_bar";
55
import { ChairRight, ChairLeft, ChairDown, ChairUp } from "../components/svgs";
66
import BasicModal from "../components/modal";
77

8+
interface Accounts {
9+
UserID: number;
10+
Username: string;
11+
}
12+
813
function Page() {
914
useEffect(() => {
1015
// Set the title directly for the browser tab
1116
document.title = "Reservation";
1217
}, []);
1318

19+
const [accounts, setAccounts] = useState<Accounts[]>([]);
20+
21+
/*
22+
useEffect(() => {
23+
fetch("http://localhost:5000/api/get-reservations")
24+
.then((response) => response.json())
25+
.then((data: { accounts: Accounts[] }) => {
26+
const simplifiedData = data.accounts.map(({ UserID, Username }) => ({
27+
UserID,
28+
Username,
29+
}));
30+
setAccounts(simplifiedData);
31+
})
32+
.catch((error) => {
33+
console.error("Error fetching data:", error);
34+
});
35+
}, []);
36+
*/
37+
1438
const [isModalOpen, setModalOpen] = React.useState(false);
1539

1640
const handleModalOpen = () => {

frontend/app/sign_in/page.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
"use client";
23
import React, { useEffect } from "react";
34
import TextInput from "../components/text_input";
@@ -40,10 +41,19 @@ function Page() {
4041
console.log("data", data.user_data);
4142
localStorage.setItem("user", JSON.stringify(data.user_data));
4243
router.push("/reservation");
43-
} else router.push("/admin_dashboard");
44+
} else {
45+
router.push("/admin_dashboard");
46+
}
4447
} else {
4548
const errorData = await response.json();
46-
console.error("Login failed:", errorData.message);
49+
if (response.status === 401) {
50+
console.error("Authentication failed:", errorData.message);
51+
// Display an alert for incorrect username or password
52+
alert("The User Name or Password is incorrect.");
53+
} else {
54+
console.error("Login failed:", errorData.message);
55+
// Handle other types of errors here
56+
}
4757
}
4858
} catch (error) {
4959
console.error(error);

0 commit comments

Comments
 (0)